home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Secrets 4 / Hacker's Secrets 4.iso / misc / practica.txt < prev    next >
Text File  |  1995-01-28  |  105KB  |  2,697 lines

  1.    
  2.                                  
  3.                                  
  4.                                  
  5.                                  
  6.                                  
  7.                       A Practical Exercise in
  8.  
  9.  
  10.                     Securing an OpenVMS System
  11.  
  12.  
  13.                                  
  14.                                  
  15.                                  
  16.                                  
  17.                                  
  18.                                  
  19.                                  
  20.                                  
  21.                                  
  22.                            Rob McMillan
  23.                           Prentice Centre
  24.                    The University Of Queensland
  25.                                  
  26.                                  
  27.                                  
  28.                                  
  29.                                  
  30.                     Now at Griffith University
  31.                  E-Mail: R.McMillan@itc.gu.edu.au
  32.                         Phone: 07 875 6557
  33.              Postal: Information Technology Services
  34.                        Griffith University
  35.                           Nathan Qld 4111
  36.                                  
  37.                                  
  38.                                  
  39.                                  
  40.                                  
  41.                                  
  42.                                  
  43.         A Practical Exercise In Securing An OpenVMS System
  44.                                  
  45.                                  
  46.                                  
  47.                                  
  48.                                  
  49.                                  
  50.                              Abstract
  51.                                  
  52.                                  
  53.    _________________________________________________________
  54.    
  55.    OpenVMS  machines have many features that can be used  to
  56.    defend   them  from  attack.  To  properly  defend   your
  57.    machine, you need to make use of these features from  the
  58.    moment of delivery.
  59.    
  60.    In  this paper, I present the series of steps taken by  a
  61.    typical systems programmer (namely the author) in  tuning
  62.    the   defense  mechanisms  of  an  OpenVMS  machine,  and
  63.    outline  some  non-standard mechanisms  employed  in  the
  64.    defence of this machine.
  65.    
  66.    All  too often, emphasis is placed on particular accents,
  67.    such  as  access prevention, or reactive examination  and
  68.    monitoring  after  attack. This  paper  attempts  a  more
  69.    holistic  approach  to  the  host-based  mechanisms  that
  70.    could  be  employed to defend a machine.  Access  control
  71.    mechanisms   (such   as  passwords,  user   authorisation
  72.    parameters,  and  access control wrappers)  and  activity
  73.    logging   mechanisms  (such  as  audit  trails,  terminal
  74.    monitors and FAL logging) are considered.
  75.    _________________________________________________________
  76.                                  
  77.    
  78.    
  79.    
  80.    
  81.    
  82.    
  83.    
  84.    The information contained in this paper is given freely
  85.    as  an account of my own experience, and may be used by
  86.    the reader as the reader sees fit.
  87.    
  88.    No  responsibility or liability will be accepted by the
  89.    author for any damages caused by direct or indirect use
  90.    of  the information or functionality described in  this
  91.    paper.
  92.                                  
  93.                                  
  94.                                  
  95.                                  
  96.                                  
  97.                                  
  98.                            Introduction
  99.    
  100.    
  101.    
  102.    1.1 Assumptions
  103.    
  104.    This paper will discuss some of the features that can  be
  105.    used  to  defend an OpenVMS machine from outside  attack.
  106.    The  ideas presented in this paper are the result  of  an
  107.    exercise   in  configuring  a  machine  in  a  university
  108.    department used for a sensitive research project.
  109.    
  110.    All  of  the mechanisms I consider in this paper  can  be
  111.    classed  as  host based mechanisms. However, the  defence
  112.    of  an  computer system is not limited to these  measures
  113.    only.
  114.    
  115.    Measures  that  should be used, but that I don't  discuss
  116.    in this paper are:
  117.    
  118.         * network based security,
  119.         * backups, and
  120.         * physical security.
  121.    
  122.    This  paper is not intended to present an "expert's view"
  123.    of  securing an OpenVMS machine. The reason for  this  is
  124.    simple  -  whilst  my  knowledge of OpenVMS  security  is
  125.    quite  solid,  I  would not put myself  in  the  "expert"
  126.    category. Therefore this paper should not be seen as  the
  127.    canonical  guide to OpenVMS security - rather, it  should
  128.    be  seen  as  the  series  of measures  that  programmers
  129.    should  typically  consider in defending  their  machine.
  130.    There  is absolutely no substitute for reading the  Guide
  131.    to VAX/VMS System Security manual.
  132.    
  133.    Finally,  this paper is concerned with the defence  of  a
  134.    machine.  I do not personally make any attempt  to  crack
  135.    machines.  I will not present any information on  how  to
  136.    crack an OpenVMS machine.
  137.    
  138.    
  139.    
  140.    1.2 What This Paper Contains
  141.    
  142.    The  following  topics  are those considered  during  the
  143.    configuration  of  the machine referred  to  above.  This
  144.    list is not exhaustive.
  145.    
  146.      * System Mechanisms For Configuring The Machine To
  147.        Control Access :
  148.    
  149.        * SYS$MANAGER Command Files
  150.        * Welcome Messages
  151.        * Accounts To Disable, Passwords To Change, And
  152.          Objects To Modify
  153.        * System Logicals And Logical Definitions
  154.        * System Passwords
  155.        * The UAF File
  156.        * File Protections
  157.        * ACLs
  158.        * Tailoring UCX
  159.        * Proxies
  160.  
  161.     * System Mechanisms For Configuring The Machine To Log
  162.       Activity :
  163.    
  164.        * Accounting
  165.        * Auditing
  166.        * FAL and Poor Man's Routing
  167.    
  168.      * Using Homegrown Or Publicly Available Software :
  169.    
  170.        * Wrappers
  171.        * Single Use PINs
  172.        * Terminal Monitors
  173.    
  174.      * Monitoring The Use of The Machine :
  175.    
  176.        * The SHOW INTRUSION Command
  177.        * Daily Activities
  178.        * Having a Live Console
  179.                                  
  180.                                  
  181.                                  
  182.                                  
  183.                                  
  184.                                  
  185.                                  
  186.                  System Mechanisms For Configuring
  187.                    The Machine To Control Access
  188.                                  
  189.    
  190.    
  191.    2.1 SYS$MANAGER Command Files
  192.    
  193.    There  are  three  files  in  SYS$MANAGER:  that  are  of
  194.    importance   in   terms   of   this   paper.   They   are
  195.    SYSTARTUP_V5.COM, SYLOGIN.COM and SYLOGICALS.COM. I  have
  196.    left  comments  about  SYLOGICALS.COM  for  Section  2.4,
  197.    System Logicals And Logical Definitions.
  198.    
  199.    
  200.    
  201.    2.1.1 SYSTARTUP_V5.COM
  202.    
  203.    There are several different things to be done here.
  204.    
  205.    As  discussed in Section 2.5, System Passwords, a  system
  206.    password  should  be installed. A system  password  means
  207.    that  the  user  must enter a password before  the  login
  208.    prompt   appears.  The  procedure  for  doing   this   is
  209.    discussed  in  Section 2.5. However, this is  the  change
  210.    you  could  make  in SYSTARTUP_V5.COM to  ensure  that  a
  211.    console  user  does not need to enter the password.  (The
  212.    console should be located in a physically secure area.)
  213.    
  214.     $! No system password required for console.
  215.     $ write sys$output "[Modifying console settings]"
  216.     $ SET TERMINAL OPA0: /PERMANENT /NOSYSPASSWORD
  217.    
  218.    This  ensures  that  should the  user  log  in  from  the
  219.    console,  a  system password will not be  required.  This
  220.    prevents  situations where you are locked  out  from  the
  221.    machine should the password be changed or forgotten.
  222.    
  223.     $! The following commands turn off account logging and 
  224.     $! delete the account log.
  225.     $! To keep an account log on your system, delete the
  226.     $! following 5 command lines.
  227.     $!
  228.     $! IF (.NOT. MICROVAX) THEN GOTO SKIP_ACCOUNTING
  229.     $! SET ACCOUNTING/DISABLE
  230.     $! IF F$SEARCH("SYS$MANAGER:ACCOUNTNG.DAT") .NES. "" THEN -
  231.     $!  DELETE SYS$MANAGER:ACCOUNTNG.DAT;*
  232.     $!SKIP_ACCOUNTING:
  233.    
  234.    When the operating system is installed, this code is  not
  235.    commented  out. That is, account logging is  not  enabled
  236.    by  default.  It  is  good practice to  use  all  logging
  237.    facilities  available  to you, and system  accounting  is
  238.    one of those facilities that is strongly recommended.
  239.    
  240.    You  need  accounting to provide an extra audit trail  on
  241.    the  system.  To  enable accounting,  comment  out  these
  242.    lines, as shown on the following page.
  243.    
  244.     $! The following commands purge the operator and network
  245.     $! logs to two versions.
  246.     $!
  247.     $! IF (.NOT. MICROVAX) THEN GOTO SKIP_PURGING
  248.     $! IF F$SEARCH("SYS$MANAGER:OPERATOR.LOG;-1") .NES. "" THEN -
  249.     $!  PURGE SYS$MANAGER:OPERATOR.LOG
  250.     $! IF F$SEARCH("SYS$MANAGER:EVL.LOG;-1") .NES. "" THEN -
  251.     $!  PURGE SYS$MANAGER:EVL.LOG
  252.     $!SKIP_PURGING:
  253.    
  254.    Here  the  machine is trying to make a  guess  about  how
  255.    much  information should be saved as current  information
  256.    (the  tradeoff being information currency and  usefulness
  257.    against  disk  space).  A more reasonable  figure  is  10
  258.    versions  (working on the basis of a new file  per  day).
  259.    To implement this, do the following:
  260.    
  261.       * Comment out the lines above.
  262.     
  263.        *  Create artificial OPERATOR.LOG and EVL.LOG  files,
  264.           each 1 version higher than the logs currently open
  265.           and in use by the system.
  266.     
  267.        *  Issue SET FILE OPERATOR.LOG /VERSION_LIMIT=10  and
  268.           SET FILE EVL.LOG /VERSION_LIMIT=10.  This is  done
  269.           against the files just created,  as  the  SET FILE
  270.           command will fail against the logs open and in use
  271.           by  the system.  When new files are opened for use
  272.           by the system, they will be created with a version
  273.           number  of  one   higher  than  the  logs  created
  274.           artificially, but will inherit the version limit.
  275.    
  276.     $! This command defines a message to be displayed before
  277.     $! each user logs in.
  278.     $!
  279.     $! DEFINE /SYSTEM SYS$ANNOUNCE " Welcome to VAX/VMS ''F$GETSYI("VERSION")'"
  280.     $ DEFINE /SYSTEM SYS$ANNOUNCE "@SYS$MANAGER:ANNOUNCE.TXT"
  281.     $!
  282.     $! This command defines a message or file to be
  283.     $! displayed after each user logs in.
  284.     $!
  285.     $ DEFINE /SYSTEM SYS$WELCOME "@SYS$MANAGER:WELCOME.TXT"
  286.     $!
  287.    
  288.    For  legal reasons, as set out in SERT Advisory  SA-93.03
  289.    (See  Appendix 1, SERT Advisory SA-93.03, Suggested Login
  290.    Banner)  give people fair warning of the consequences  of
  291.    misuse.  The  contents  of  the  files  ANNOUNCE.TXT  and
  292.    WELCOME.TXT   are  discussed  in  Section  2.2,   Welcome
  293.    Messages.  To  make these files appear,  the  definitions
  294.    above are used.
  295.    
  296.    
  297.    
  298.    
  299.    2.1.2 SYLOGIN.COM
  300.    
  301.    SYLOGIN.COM  is  a command file executed  when  any  user
  302.    logs  in.  This is the ideal place to install  mechanisms
  303.    to  universally  check  a  user's  credentials  (such  as
  304.    username,  source of login, time, terminal or  knowledge-
  305.    based authenticators).
  306.    
  307.    The  first  three  lines  of  SYLOGIN.COM  should  be  as
  308.    follows (but aren't in the supplied file).
  309.    
  310.     $ SET NOON
  311.     $ SET NOCONTROL_Y
  312.     $ SET NOVERIFY
  313.    
  314.    
  315.    This  prevents a user (and hence crackers  in  the  first
  316.    instance)   from   seeing  what   mechanisms   you   have
  317.    installed,  and also interrupting the execution  of  this
  318.    file to avoid these mechanisms.
  319.    
  320.     $! Place your site-specific LOGIN commands below
  321.     $!
  322.     $! If they get this far, then there may have been a breakin,
  323.     $! but at least we can stop them at this point.
  324.     $! Call the wrapper.
  325.     $!
  326.     $  @LOCAL$WRAP:INTERACTIVE.COM
  327.     $  IF ($Status .NE. %x10000001)
  328.     $  THEN
  329.     $    STOP/ID=0
  330.     $  ENDIF
  331.    
  332.    As  the  comments outline, we use a command procedure  at
  333.    this  point  to check credentials. This may  or  may  not
  334.    involve  interactive exchanges. If the person logging  in
  335.    fails  to pass the tests, then they are logged out.  (You
  336.    will   need   to  define  LOCAL$WRAP,  for  example,   in
  337.    SYLOGICALS.COM.)
  338.    
  339.    
  340.    
  341.    
  342.    
  343.    
  344.    2.2 Welcome Messages
  345.    
  346.    For  legal reasons, as set out in SERT Advisory  SA-93.03
  347.    (See  Appendix 1, SERT Advisory SA-93.03, Suggested Login
  348.    Banner)  give people fair warning of the consequences  of
  349.    misuse.  By default, there is no SYS$WELCOME issued,  and
  350.    SYS$ANNOUNCE welcomes the person logging in.  SYS$WELCOME
  351.    needs   to   be  enabled,  and  point  to  a  file,   and
  352.    SYS$ANNOUNCE  should also point to a file  (as  shown  in
  353.    Section  2.1.1,  SYSTARTUP_V5.COM).  These  files  should
  354.    outline   to   people  conditions  of  use,   and   legal
  355.    consequences of misuse.
  356.    
  357.    SYS$ANNOUNCE  is  the  message  or  banner  that  appears
  358.    immediately  before  the  login  prompt  (but  after  the
  359.    system  password  has been entered). SYS$WELCOME  is  the
  360.    message  or  banner  that appears immediately  after  the
  361.    person  has logged in. In this way, users should normally
  362.    see this warning before and after logging in.
  363.    
  364.    This message should appear in SYS$MANAGER:ANNOUNCE.TXT:
  365.    
  366.    
  367.    
  368.    ----- Warning Message -----
  369.    
  370.              ***** This service is for authorised staff only *****
  371.    
  372.    *************************************************************************
  373.    *                                                                       *
  374.    * WARNING:   It is a criminal offence to:                               *
  375.    *            i. Obtain access to data without authority                 *
  376.    *                    (Penalty 2 years imprisonment)                     *
  377.    *            ii Damage, delete, alter or insert data without authority  *
  378.    *                    (Penalty 10 years imprisonment)                    *
  379.    *                                                                       *
  380.    *************************************************************************
  381.    
  382.    
  383.    The     following     message    should     appear     in
  384.    SYS$MANAGER:WELCOME.TXT.
  385.  
  386.    
  387.         This is {nodename} (VAX/VMS V5.5-2) - Unauthorised access prohibited!
  388.    
  389.            ***** This service is for authorised staff only *****
  390.    
  391.    *************************************************************************
  392.    *                                                                       *
  393.    * WARNING:    It is a criminal offence to:                              *
  394.    *             i. Obtain access to data without authority                *
  395.    *                    (Penalty 2 years imprisonment)                     *
  396.    *             ii Damage, delete, alter or insert data without authority *
  397.    *                    (Penalty 10 years imprisonment)                    *
  398.    *                                                                       *
  399.    *************************************************************************
  400.    
  401.    
  402.    
  403.    
  404.    2.3 Accounts To Disable, Passwords To Change, And Objects
  405.        To Modify
  406.    
  407.    2.3.1 Accounts
  408.    
  409.    VMS  is  supplied with a number of default  accounts.  It
  410.    should   be   assumed  that  crackers  will  attempt   to
  411.    compromise  a  machine using default  account  names  and
  412.    passwords.  This  principle  applies  to  any   operating
  413.    system.
  414.    
  415.    The   following  default  accounts  should   have   their
  416.    passwords  changed,  and the accounts disabled:  DEFAULT,
  417.    FIELD, MIRRO$SERVER, SYSTEST, SYSTEST_CLIG.
  418.    
  419.    The accounts can be disabled thus:
  420.    
  421.     $ MCR AUTHORIZE
  422.     UAF> MODIFY DEFAULT      /FLAGS=DISUSER
  423.     UAF> MODIFY FIELD        /FLAGS=DISUSER
  424.     UAF> MODIFY MIRRO$SERVER /FLAGS=DISUSER
  425.     UAF> MODIFY SYSTEST      /FLAGS=DISUSER
  426.     UAF> MODIFY SYSTEST_CLIG /FLAGS=DISUSER
  427.     UAF> EXIT
  428.     $
  429.    
  430.    Depending  upon  how you wish to execute batch  jobs  and
  431.    carry  out  general system administration, you  may  also
  432.    wish  to  either similarly treat the SYSTEM  account,  or
  433.    alternative apply strict access controls on this  account
  434.    on the UAF file (See Section 2.6, The UAF File).
  435.    
  436.    
  437.    
  438.    2.3.2 Objects
  439.    
  440.    There are several objects that needed tailoring. Some  of
  441.    the  tailoring  is  to prevent simple security  breaches,
  442.    whereas  others  (like the modifications to  PHONE,  TASK
  443.    and  FAL)  are  to prevent breaches that could  occur  in
  444.    whole or in part to Poor Man's Routing (See Section  3.3,
  445.    FAL and Poor Man's Routing).
  446.    
  447.    In  the  first  stage,  the PHONE and  TASK  objects  are
  448.    disabled.
  449.    
  450.    In  the  PHONE application, the directory command can  be
  451.    used  to  obtain a directory listing of users  on  remote
  452.    DECNet  nodes.  It  is  essentially a  default  "finger".
  453.    Whilst security through obscurity is no security at  all,
  454.    any  access to system details should be suppressed  where
  455.    possible.
  456.    
  457.    The  TASK  object is used to execute jobs  on  your  node
  458.    from  remote  nodes. Since this is not a desired  feature
  459.    on  the  machine used in the preparation of  this  paper,
  460.    this  object  was  disabled.  Alternatively,  the  object
  461.    could  have been loaded with false information  into  the
  462.    permanent database.
  463.    
  464.    These  objects  are  created at boot time  using  default
  465.    information if there is no information about them in  the
  466.    NCP  permanent  database. Therefore, a  job  can  be  run
  467.    immediately after booting to remove these objects.
  468.    
  469.    The objects can be removed thus:
  470.    
  471.     $ MCR NCP CLEAR OBJECT PHONE ALL
  472.     $ MCR NCP PURGE OBJECT PHONE ALL
  473.     $ MCR NCP CLEAR OBJECT TASK  ALL
  474.     $ MCR NCP PURGE OBJECT TASK  ALL
  475.    
  476.    They could alternatively be modified thus:
  477.    
  478.     $ MCR NCP SET    OBJECT TASK  USER  ILLEGAL PASSWORD DISABLED
  479.     $ MCR NCP SET    OBJECT TASK  PROXY NONE
  480.     $ MCR NCP SET    OBJECT TASK  ALIAS INCOMING DISABLED
  481.     $ MCR NCP SET    OBJECT TASK  ALIAS OUTGOING DISABLED
  482.     $ MCR NCP DEFINE OBJECT TASK  USER  ILLEGAL PASSWORD DISABLED
  483.     $ MCR NCP DEFINE OBJECT TASK  PROXY NONE
  484.     $ MCR NCP DEFINE OBJECT TASK  ALIAS INCOMING DISABLED
  485.     $ MCR NCP DEFINE OBJECT TASK  ALIAS OUTGOING DISABLED
  486.     $ MCR NCP SET    OBJECT PHONE USER  ILLEGAL PASSWORD DISABLED
  487.     $ MCR NCP SET    OBJECT PHONE PROXY NONE
  488.     $ MCR NCP SET    OBJECT PHONE ALIAS INCOMING DISABLED
  489.     $ MCR NCP SET    OBJECT PHONE ALIAS OUTGOING DISABLED
  490.     $ MCR NCP DEFINE OBJECT PHONE USER  ILLEGAL PASSWORD DISABLED
  491.     $ MCR NCP DEFINE OBJECT PHONE PROXY NONE
  492.     $ MCR NCP DEFINE OBJECT PHONE ALIAS INCOMING DISABLED
  493.     $ MCR NCP DEFINE OBJECT PHONE ALIAS OUTGOING DISABLED
  494.    
  495.    In  the second stage below, objects are modified so  that
  496.    they  are  still usable, but subject to tighter  controls
  497.    than the default.
  498.    
  499.    The  simplest  change  is made to the  MIRROR  object  by
  500.    disabling   the   MIRRO$SERVER  account   in   the   User
  501.    Authorisation File. The MIRROR object should be  kept  to
  502.    allow  loopback  testing should it become necessary.  The
  503.    account  is  disabled since it serves no  useful  purpose
  504.    (other   than  for  loopback  testing),  and  should   be
  505.    disabled unless in use.
  506.    
  507.    The  MAIL object should be modified thus according to the
  508.    VMS  v5.5-2  release  notes, Section 2.8.7,  to  restrict
  509.    outgoing  access  on  the mail server.  In  v5.5-2,  MAIL
  510.    enables   system  privileges  when  it  opens  a   DECnet
  511.    connection  to  a  remote  mail  server.  By  restricting
  512.    outgoing  access  on the mail server object  (as  below),
  513.    unauthorised    users   are   prevented   from    placing
  514.    connections on the mail server object.
  515.    
  516.     $ MCR NCP SET    OBJECT MAIL OUTGOING CONNECT PRIVILEGE SYSPRV
  517.     $ MCR NCP DEFINE OBJECT MAIL OUTGOING CONNECT PRIVILEGE SYSPRV
  518.    
  519.    This  can  be undone by executing the same commands  with
  520.    "NOSYSPRV".  MAIL_SERVER.EXE (the  executable  associated
  521.    with  the  MAIL  object)  is installed  as  a  privileged
  522.    image.
  523.  
  524.    Wrappers  should also be installed for the  FAL  and  NML
  525.    objects.  The  executable  images  for  these   are,   by
  526.    default,   normally  FAL.EXE  and  NML.EXE  respectively.
  527.    Modify the object database as shown below.
  528.    
  529.     $ MCR NCP SET    OBJECT FAL FILE LOCAL$WRAP:FAL.COM
  530.     $ MCR NCP DEFINE OBJECT FAL FILE LOCAL$WRAP:FAL.COM
  531.     $ MCR NCP SET    OBJECT NML FILE LOCAL$WRAP:NML.COM
  532.     $ MCR NCP DEFINE OBJECT NML FILE LOCAL$WRAP:NML.COM
  533.    
  534.    The  contents  of the wrappers are discussed  in  Section
  535.    4.1, Wrappers.
  536.    
  537.  
  538.    
  539.    
  540.    2.4 System Logicals And Logical Definitions
  541.    
  542.    SYS$MANAGER:SYLOGICALS.COM   is   used    to    establish
  543.    important  site-specific logical names across the  entire
  544.    system. You can put meaningful local definitions in  here
  545.    as  well  as  the definitions already supplied  with  the
  546.    delivered system.
  547.    
  548.     $! Undocumented feature to disable poor man's routing
  549.     $  DEFINE /SYSTEM /EXEC  FAL$LOG  "03/DISABLE=8"
  550.    
  551.    Poor  Man's Routing is explained in Section 3.3, FAL  and
  552.    Poor Man's Routing.
  553.    
  554.    That  section  also  explains the  significance  of  this
  555.    definition.  It's  relevance to this  section  is  merely
  556.    that it is centrally defined in SYLOGICALS.COM.
  557.    
  558.     $! Make network server processes die after 10 seconds
  559.     $! (to give separate NETSERVER.LOG files for
  560.     $! each distinct operation)
  561.     $ DEFINE /SYSTEM /EXEC  NETSERVER$TIMEOUT  "0000 00:00:10"
  562.    
  563.    This  forces  network server processes to  die  after  10
  564.    seconds   of   lying   idle,   thus   creating   separate
  565.    NETSERVER.LOG   files   for  each  essentially   distinct
  566.    operation. The tradeoff for these distinct files  is  the
  567.    price  that must be paid in terms of process creation  on
  568.    each network connection.
  569.    
  570.     $! System databases
  571.     $ DEFINE /SYSTEM /EXEC LMF$LICENSE    SYS$SYSTEM:LMF$LICENSE.LDB
  572.     $ DEFINE /SYSTEM /EXEC NETNODE_REMOTE SYS$SYSTEM:NETNODE_REMOTE.DAT
  573.     $ DEFINE /SYSTEM /EXEC NETPROXY       SYS$SYSTEM:NETPROXY.DAT
  574.     $ DEFINE /SYSTEM /EXEC NETUAF         SYS$SYSTEM:NETUAF.DAT
  575.     $ DEFINE /SYSTEM /EXEC RIGHTSLIST     SYS$SYSTEM:RIGHTSLIST.DAT
  576.     $ DEFINE /SYSTEM /EXEC SYSUAF         SYS$SYSTEM:SYSUAF.DAT
  577.     $ DEFINE /SYSTEM /EXEC VMSMAIL        SYS$SYSTEM:VMSMAIL_PROFILE.DAT
  578.    
  579.    If  these  aren't defined, and a user attempts operations
  580.    on  them,  new  ones can be created by that  user.  These
  581.    definitions  prevent  this.  Note  file  protections  for
  582.    these files in Section 2.7, File Protections.
  583.    
  584.    Other  system-wide logical symbols (such  as  LOCAL$WRAP)
  585.    would also be defined in this file.
  586.    
  587.    
  588.    
  589.    
  590.    2.5 System Passwords
  591.    
  592.    VMS  systems can have what is called a "system password".
  593.    This  is  a password that must be typed BEFORE  the  host
  594.    prompts  you for login information. So when you initially
  595.    connect  to a system with a "system password", you  don't
  596.    get  any prompting on the screen. Once you have typed  in
  597.    the password, the normal prompt message appears.
  598.  
  599.    The  system password will appear or not depending on  the
  600.    value  of  the sysgen parameter TTY_DEFCHAR2. A value  of
  601.    %X80000   (i.e.   Hex)  enables  system  password.   This
  602.    parameter is not dynamic.
  603.    
  604.    The  SYSGEN  parameter TTY_DEFCHAR2 (bit  represented  by
  605.    %X80000)  enables  system password  by  default  for  all
  606.    terminals (including LAT, X.25 and telnet terminals).
  607.    
  608.    The default value for TTY_DEFCHAR2 is 4098 (decimal):
  609.    
  610.     $ RUN SYS$SYSTEM:SYSGEN
  611.     SYSGEN>  USE DEFAULT
  612.     SYSGEN>  SHO TTY_DEFCHAR2
  613.     Parameter Name   Current   Default    Min.    Max.      Unit   Dynamic
  614.     --------------   -------   -------   ------  ------     ----   -------
  615.     TTY_DEFCHAR2        4098      4098     0       -1    Bit-Encode
  616.    
  617.  
  618.    The    correct   value   can   be   set   by    modifying
  619.    SYS$SYSTEM:MODPARAMS.DAT, and AUTOGENing the system.  The
  620.    required  value  in MODPARAMS.DAT is set  by  adding  the
  621.    following lines (amongst other values):
  622.    
  623.     TTY_DEFCHAR2 = %X80000 + %X1000 + %X2  ! = 528386
  624.                  ! %X80000 (bit 19)     TT2$M_SYSPWD   System password
  625.                  ! %X1000  (bit 12)     TT2$M_EDITING  Cmd line editing
  626.                  ! %X2     (bit 1)      TT2$M_AUTOBAUD Autobaud
  627.    
  628.    The actual system password can be set either by DCL or
  629.    by AUTHORIZE.
  630.    
  631.     $ SET PASSWORD /SYSTEM
  632.    
  633.    or else by
  634.    
  635.     $ RUN SYS$SYSTEM:AUTHORIZE
  636.     UAF> MODIFY /SYSTEM_PASSWORD={password}
  637.    
  638.    Terminals  can  be set /NOSYSPWD /PERM  or  /SYSPWD.  See
  639.    Section 2.1.1 SYSTARTUP_V5.COM for an example.
  640.    
  641.    
  642.    2.6 The UAF File
  643.    
  644.    This  is an extremely useful file for tuning security  on
  645.    an  OpenVMS machine. The UAF file (and associated  files)
  646.    allow  you  to control access to the system and  allocate
  647.    resources to users.
  648.    
  649.    For  the purposes of this paper, there are several fields
  650.    worth  considering. Specifically, the ones  that  can  be
  651.    used  include (but are not restricted to) access  control
  652.    fields, password control fields and the rights list.
  653.    
  654.    On  the  particular  machine used in the  preparation  of
  655.    this paper, there are several accounts that are used  for
  656.    specific  purposes,  and  should  be  used  only   within
  657.    specific  time frames. For instance, consider an  account
  658.    (the  "USER1"  account for the purposes of this  example)
  659.    which  should only be used interactively during the hours
  660.    of  8am  to  7pm on primary days (Monday to Friday),  but
  661.    can  run  batch  jobs at any time on any day.  All  other
  662.    access is to be denied.
  663.    
  664.    This is achieved by the following commands:
  665.    
  666.     $ RUN SYS$SYSTEM:AUTHORIZE
  667.     UAF> MODIFY USER1 /NONETWORK /NODIALUP -
  668.          /LOCAL=(PRIMARY:8-18) /REMOTE=(PRIMARY:8-18)
  669.    
  670.  
  671.    This  results  in an access control matrix like  the  one
  672.    below.
  673.    
  674.    Primary days:   Mon Tue Wed Thu Fri 
  675.    Secondary days:                     Sat Sun
  676.    Primary   000000000011111111112222  Secondary   00000000001111111111222
  677.    Day Hours 012345678901234567890123  Day Hours   012345678901234567890123
  678.    Network:  -----  No access  ------            -----  No access  ------
  679.    Batch:    ##### Full access ######            ##### Full access######
  680.    Local:    --------###########-----            -----  No access  ------
  681.    Dialup:   -----  No access  ------            -----  No access  ------
  682.    Remote:   --------###########-----            -----  No access  ------
  683.    
  684.  
  685.    Full access can be restored using:
  686.    
  687.     $ RUN SYS$SYSTEM:AUTHORIZE
  688.     UAF> MODIFY USER1 /ACCESS=(PRIMARY:0-24,SECONDARY:0-24)
  689.    
  690.    Passwords  are  historically a  weak  point  in  computer
  691.    systems.  A weak password on a single account leaves  the
  692.    entire  system  vulnerable to attack.  (See  Appendix  2,
  693.    SERT  Advisory  SA-93.04,  Guidelines  For  Developing  A
  694.    Sensible Password Policy.)
  695.    
  696.    You  must  therefore  ensure that  all  accounts  have  a
  697.    minimum  password length of 8 characters, and  that  they
  698.    expire  at  regular  intervals. In  addition,  privileged
  699.    accounts should have password lengths greater than  that,
  700.    and   passwords   should   be  set   using   the   MODIFY
  701.    {accountname} /GENERATE_PASSWORD command.
  702.    
  703.    The  other  important  use of the  AUTHORIZE  utility  is
  704.    creating  rights  list identifiers  and  using  these  in
  705.    conjunction  with  ACLs to control access  to  files  and
  706.    devices at individual levels.
  707.    
  708.    For  instance,  on the machine used while preparing  this
  709.    paper, there is a particular device and a directory  that
  710.    should  only ever be accessed by a small group of people.
  711.    This  device  is  used for a research  project,  and  the
  712.    results  are kept in the directory. The entire  group  of
  713.    people  involved with the experiment needed to  read  the
  714.    results  (kept  in  the  DISKE:[EXPERIMENT1]  directory),
  715.    whereas  only  a few people needed write access  to  this
  716.    directory.  Furthermore, because they  were  all  in  the
  717.    same  project  team,  they were all  allocated  the  same
  718.    group  number. Finally, there was a restricted number  of
  719.    people  in  this group who were authorised to access  the
  720.    device used in the experiment in question.
  721.    
  722.    The  first step in controlling this is to create  various
  723.    rights list identifiers, and granting them to people  who
  724.    should  access  them.  The rights  list  identifiers  are
  725.    created as follows:
  726.    
  727.     $ RUN SYS$SYSTEM:AUTHORIZE
  728.     UAF> ADD /IDENTIFIER EXP1_READ
  729.     UAF> ADD /IDENTIFIER EXP1_WRITE
  730.     UAF> ADD /IDENTIFIER EXP1_CONTROL
  731.     UAF> EXIT
  732.  
  733.  
  734.    Users  1..10  are  allowed read access  to  the  results;
  735.    users  5,  6 and 7 are allowed write access and  users  6
  736.    and 7 are allowed to control the transducer.
  737.  
  738.     $ RUN SYS$SYSTEM:AUTHORIZE
  739.     UAF> GRANT /IDENTIFIER EXP1_READ    USER1
  740.     UAF> GRANT /IDENTIFIER EXP1_READ    USER2
  741.     UAF> GRANT /IDENTIFIER EXP1_READ    USER3
  742.     UAF> GRANT /IDENTIFIER EXP1_READ    USER4
  743.     UAF> GRANT /IDENTIFIER EXP1_READ    USER8
  744.     UAF> GRANT /IDENTIFIER EXP1_READ    USER9
  745.     UAF> GRANT /IDENTIFIER EXP1_READ    USER10
  746.     UAF> GRANT /IDENTIFIER EXP1_WRITE   USER5
  747.     UAF> GRANT /IDENTIFIER EXP1_WRITE   USER6
  748.     UAF> GRANT /IDENTIFIER EXP1_WRITE   USER7
  749.     UAF> GRANT /IDENTIFIER EXP1_CONTROL USER6
  750.     UAF> GRANT /IDENTIFIER EXP1_CONTROL USER7
  751.     UAF> EXIT
  752.     $
  753.    
  754.    ACLs  and  protection  are then set  on  the  device  and
  755.    directory as set out in Section 2.8, ACLs.
  756.    
  757.    Finally,  great care has been taken in the allocation  of
  758.    privileges  to  individual user accounts. In  particular,
  759.    the  default  privileges  must be  kept  to  the  minimum
  760.    required.
  761.    
  762.    
  763.    
  764.    2.7 File Protections
  765.    
  766.    File  protection  is an important aspect in  preventative
  767.    security. Checks should be periodically carried  out  for
  768.    world-writeable  files and directories,  and  appropriate
  769.    action taken.
  770.    
  771.    In  addition, various sensitive files should be confirmed
  772.    as having the following protection.
  773.    
  774.     <disk>:[000000]000000.DIR      (S:RWE,O:RWE,G:RE,W:E)
  775.     <disk>:[000000]INDEXF.SYS      (S:RWE,O:RWE,G:RE,W)
  776.    
  777.        *  This  prevents  unauthorised  users  from  finding
  778.           directory and file names.
  779.    
  780.     SYS$SYSTEM:AUTHORIZE.EXE       (S:RWE,O:RWE,G:RWE,W)
  781.     SYS$SYSTEM:NCP.EXE             (S:RWE,O:RWE,G:RWE,W)
  782.    
  783.       *  This ensures that unauthorised users cannot  change
  784.          the NCP and authorisation databases through the use
  785.          of these  programs.  Note  that  merely  protecting
  786.          these programs does not prevent modification of the
  787.          data  files - it  is imperative that the data files
  788.          themselves are protected.
  789.    
  790.     SYS$SYSTEM:NETCIRC.DAT        (S:RWE,O:RWE,G:RWE,W)
  791.     SYS$SYSTEM:NETCONF.DAT        (S:RWE,O:RWE,G:RWE,W)
  792.     SYS$SYSTEM:NETLINE.DAT        (S:RWE,O:RWE,G:RWE,W)
  793.     SYS$SYSTEM:NETLOGING.DAT      (S:RWE,O:RWE,G:RWE,W)
  794.     SYS$SYSTEM:NETNODE_LOCAL.DAT  (S:RWE,O:RWE,G:RWE,W)
  795.     SYS$SYSTEM:NETNODE_REMOTE.DAT (S:RWE,O:RWE,G:RWE,W)
  796.     SYS$SYSTEM:NETOBJECT.DAT      (S:RWE,O:RWE,G:RWE,W)
  797.     SYS$SYSTEM:NETPROXY.DAT       (S:RWE,O:RWE,G:RWE,W)
  798.     SYS$SYSTEM:NETUAF.DAT         (S:RWE,O:RWE,G:RWE,W)
  799.     SYS$SYSTEM:NETX25.DAT         (S:RWE,O:RWE,G:RWE,W)
  800.     SYS$SYSTEM:NETX29.DAT         (S:RWE,O:RWE,G:RWE,W)
  801.    
  802.       *  This ensures that unauthorised users cannot  change
  803.          information   in   these   databases,   nor    gain
  804.          information    about    other   users   or   system
  805.          configuration from these files.
  806.    
  807.     SYS$SYSTEM:RIGHTSLIST.DAT        (S:RWE,O:RWE,G:RE,W:RE)
  808.    
  809.     SYS$SYSTEM:SYSUAF.DAT            (S:RWE,O:RWE,G:RWE,W)
  810.                                      ACL=(NETWORK,ACCESS=EXECUTE)
  811.    
  812.     SYS$SYSTEM:VMSMAIL.DAT           (S:RWE,O:RWE,G:RWE,W)
  813.    
  814.     SYS$SYSTEM:VMSMAIL_PROFILE.DATA  (S:RWE,O:RWE,G:RWE,W)
  815.    
  816.       *  This ensures that unauthorised users cannot  change
  817.          information   in    these   databases,   nor   gain
  818.          information about other users from these files.
  819.    
  820.    For  more  details  on  File  Protections,  see  Managing
  821.    Security  in  a Multi-Vendor Network by Ron Tencati,  and
  822.    also the Guide to VAX/VMS System Security manual.
  823.    
  824.    
  825.    
  826.    
  827.    2.8 ACLs
  828.    
  829.    This  section, is a continuation of the example  supplied
  830.    in  Section 2.6, The UAF File, about access control using
  831.    rights list identifiers.
  832.    
  833.    In  a  particular  experiment, experimental  results  are
  834.    being  kept  in  the DISKE:[EXPERIMENT1]  directory.  The
  835.    results  are  obtained using a transducer  controlled  on
  836.    device RCD0:.
  837.    
  838.    Various   rights   list  identifiers  to   read   results
  839.    (EXP1_READ),  write  a  file  to  the  results  directory
  840.    (EXP1_WRITE)  and  control the transducer  (EXP1_CONTROL)
  841.    have  been created. These rights identifiers are used  in
  842.    the  the  creation  of access control  lists  to  enforce
  843.    these access control principles.
  844.    
  845.    The transducer is the first object so modified:
  846.    
  847.     $ SET ACL /OBJECT=DEVICE /ACL=( -
  848.      (IDENTIFIER=SYSTEM,ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL), -
  849.      (IDENTIFIER=EXP1_CONTROL,ACCESS=READ+WRITE+DELETE+CONTROL), -
  850.      (IDENTIFIER=[*,*],ACCESS=NONE)) RCD0:
  851.    
  852.     $ SHOW DEVICE RCD0: /FULL
  853.                  :
  854.     {Device details on NODE1$RCD0: deleted}
  855.                  :
  856.     device, error logging is enabled.
  857.     Error count                0    Operations completed 26
  858.     Owner process             ""    Owner UIC   [0,0]
  859.     Owner process ID    00000000    Dev Prot    S:RWED,O:RWED,G:RWED,W:RWED
  860.     Reference count            0    Default buffer size   2048
  861.     Density              unknown    Format  {deleted}
  862.     Volume status:  {deleted}
  863.    
  864.     Device access control list:
  865.     (IDENTIFIER=[SYSTEM],ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL)
  866.     (IDENTIFIER=EXP1_CONTROL,ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL)
  867.     (IDENTIFIER=[*,*],ACCESS=NONE)
  868.    
  869.    
  870.    On  the machine used for preparing this paper, the nature
  871.    of  the  device prevented us from changing the protection
  872.    using  the  SET PROTECTION/DEVICE command.  However,  the
  873.    ACL is sufficient to control access to this device.
  874.    
  875.    The  next  step  is to protect the directory  (and  files
  876.    under  it).  An  ACL  is applied to  the  directory  file
  877.    usinfg the commands on the next page.
  878.    
  879.     $ SET ACL /OBJECT=FILE /ACL=( -
  880.        (IDENTIFIER=EXP1_WRITE,ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL), -
  881.        (IDENTIFIER=EXP1_READ, ACCESS=READ+EXECUTE), -
  882.        (IDENTIFIER=SYSTEM,    ACCESS=READ+EXECUTE), -
  883.        (IDENTIFIER=[*,*],     ACCESS=NONE)) DISKE:[000000]EXPERIMENT1.DIR
  884.     $
  885.     $ SET PROTECTION DISKE:[000000]EXPERIMENT1.DIR /PROTECTION=(S,O,G,W)
  886.     $
  887.    
  888.    
  889.     $ DIR DISKE:[000000]EXPERIMENT1.DIR /SECURITY
  890.     Directory DISKE:[000000]
  891.     
  892.     EXPERIMENT1.DIR;1     4    17-JUN-1992 11:19:27.01  [SYSTEM] (,,,)
  893.     (IDENTIFIER=EXP1_WRITE,ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL)
  894.     (IDENTIFIER=EXP1_READ,ACCESS=READ+EXECUTE)
  895.     (IDENTIFIER=[SYSTEM],ACCESS=READ+EXECUTE)
  896.     (IDENTIFIER=[*,*],ACCESS=NONE)
  897.     Total of 1 file, 4 blocks.
  898.     
  899.  
  900.    This means that only people who specifically possess  the
  901.    EXP1_WRITE  rights  list identifier  can  write  to  this
  902.    directory.  Users  who  possess the EXP1_READ  identifier
  903.    can  read the contents of the directory as can the SYSTEM
  904.    account  (but  not system privileged accounts  or  system
  905.    UIC group members). All other access is denied.
  906.    
  907.    Note  that action is taken on the first match of the ACL.
  908.    So,  for example, if the SYSTEM account is being used  to
  909.    access   data  in  DISKE:[EXPERIMENT1],  and  the  system
  910.    account  has  the EXP1_READ right, then SYSTEM  can  read
  911.    the  data by virtue of this right as opposed to being the
  912.    system   account.  The  reason  for  this  is  that   the
  913.    EXP1_READ identifier occurs before [SYSTEM] in the ACL.
  914.    
  915.    Any  directories  created  in this  directory  after  the
  916.    creation of this ACL will inherit this ACL.
  917.    
  918.    
  919.    
  920.    
  921.    2.9 SYSGEN Parameters
  922.    
  923.    There   are  various  SYSGEN  parameters  that  must   be
  924.    considered and/or changed during configuration.  Many  of
  925.    these  are  related  to system performance  and  are  not
  926.    within  the scope of this paper. Parameters that must  be
  927.    considered  from  a  security point of  view  are  listed
  928.    below,  with  extracts from the SYSGEN HELP  facility  on
  929.    their   use.  (See  SYSGEN>  HELP  PARAMETERS  for   more
  930.    details.)
  931.    
  932.    TTY_DEFCHAR2: Bit 19 (TT2$M_SYSPWD) is set to  allow  the
  933.    use  of system passwords. The password was set using  the
  934.    AUTHORIZE  utility  (see Section 2.5, System  Passwords),
  935.    and  the  console is modified such that the  password  is
  936.    not  required when logging on from that source (using SET
  937.    TERMINAL  OPA0: /PERMANENT /NOSYSPASSWORD). (See  Section
  938.    2.1.1, SYSTARTUP_V5.COM.) All other terminals must  enter
  939.    the system password before the login prompt is issued.
  940.    
  941.    
  942.    This  parameter  (TTY_DEFCHAR2). amongst others,  can  be
  943.    set in SYS$SYSTEM:MODPARAMS.DAT with a single line:
  944.    
  945.    TTY_DEFCHAR2 = %X80000 + %X1000 + %X2        ! = 528386
  946.                 ! %X80000 (bit 19)   TT2$M_SYSPWD   System password
  947.                 ! %X1000  (bit 12)   TT2$M_EDITING  Cmd line editing
  948.                 ! %X2     (bit 1)    TT2$M_AUTOBAUD Autobaud
  949.    
  950.    
  951.    LGI_PWD_TMO: Period of time, in seconds, a  user  has  to
  952.    correctly  enter  the system password on  a  terminal  on
  953.    which the system password is in effect.
  954.    
  955.    LGI_BRK_TMO:  Specifies  the number  of  seconds  that  a
  956.    user,  terminal, or node is permitted to attempt a  login
  957.    before  the  system  assumes that a  breakin  attempt  is
  958.    occurring and evasive action is required.
  959.    
  960.    LGI_BRK_LIM:  Specifies the number of failures  that  may
  961.    occur  at  login time before the system will take  action
  962.    against a possible breakin.
  963.    
  964.    LGI_RETRY_TMO:  Specifies the number of  seconds  allowed
  965.    between login retry attempts after a login failure.
  966.    
  967.    LGI_RETRY_LIM:  Specifies the number  of  retry  attempts
  968.    allowed for users attempting to login over dialup lines.
  969.    
  970.    LGI_HID_TIM:   Specifies  the  number  of  seconds   that
  971.    evasive action will persist following the detection of  a
  972.    possible breakin attempt. The evasive action consists  of
  973.    refusing   to  allow  any  logins  during  this   period,
  974.    regardless of whether a valid user name and password  are
  975.    specified.
  976.    
  977.    LGI_BRK_DISUSER: When set, turns on the DISUSER  flag  in
  978.    the  UAF  record when an attempted breakin  is  detected,
  979.    thus permanently locking out that account.
  980.    
  981.    LGI_BRK_TERM: Causes the terminal name to be part of  the
  982.    association  string  for  the terminal  mode  of  breakin
  983.    detection.
  984.    
  985.    Note  that if parameters are changed using SYSGEN, modify
  986.    both  the  CURRENT image and the ACTIVE, running  system.
  987.    Leave DEFAULT as it is.
  988.    
  989.    
  990.    
  991.  
  992.    2.10 Tailoring UCX
  993.    
  994.    The  machine  being  configured  required  only  incoming
  995.    telnet  access,  and outgoing telnet  and  ftp.  SMTP  is
  996.    handled  by a dedicated mail package (MX). Other services
  997.    like  SNMP,  NFS  and  Berkeley  "r"  commands  are   not
  998.    required (or, in fact, desirable).
  999.    
  1000.    Services not required are shutdown thus:
  1001.    
  1002.     $! -- Shutdown what we don't need
  1003.     $!
  1004.     $ @SYS$MANAGER:RPC$UCX_SHUTDOWN.COM
  1005.     $ @SYS$MANAGER:UCX$LPD_SHUTDOWN.COM
  1006.     $ @SYS$MANAGER:UCX$NFS_SHUTDOWN.COM
  1007.     $ @SYS$MANAGER:UCX$SMTP_SHUTDOWN.COM
  1008.     $ @SYS$MANAGER:UCX$SNMP_SHUTDOWN.COM
  1009.     $!
  1010.     $! -- Disable incoming connections on other services
  1011.     $!
  1012.     $ UCX DISABLE SERVICE FTP
  1013.     $ UCX DISABLE SERVICE REXEC
  1014.     $ UCX DISABLE SERVICE RLOGIN
  1015.     $ UCX DISABLE SERVICE RSH
  1016.  
  1017.   
  1018.    In  addition, the relevant UCX accounts are  disabled  in
  1019.    the  User Authorization File (using UAF> MODIFY <account>
  1020.    /flag=DisUser):  UCX$FTP,  UCX$NFS,  UCX$REXEC,  UCX$RSH,
  1021.    UCX$SNMP, UCX_LPD, UCX_SMTP. Telnet (interactive)  access
  1022.    should  be  monitored using a wrapper  (as  discussed  in
  1023.    Section 4.1, Wrappers).
  1024.    
  1025.    
  1026.    2.11 Proxies
  1027.    
  1028.    Proxies  should not be allowed if they are not  required!
  1029.    If  a  net proxy is required for file transfer, the proxy
  1030.    must  be  created on the remote machine, and the required
  1031.    command  issued on the local machine. The theory here  is
  1032.    that  the  local machine is less likely to be compromised
  1033.    than  an  outside  machine, and the use of  proxies  will
  1034.    reduce   the   instances  of  access  information   being
  1035.    transmitted over a network connection.
  1036.    
  1037.    Only  allow  proxy access to a non-privileged account  on
  1038.    the target system.
  1039.    
  1040.    
  1041.    
  1042.    
  1043.    
  1044.    
  1045.    
  1046.                  System Mechanisms For Configuring
  1047.                     The Machine To Log Activity
  1048.    
  1049.    
  1050.    
  1051.    
  1052.    There  are  several facilities available  to  the  system
  1053.    administrator to achieve effective logging.  Specifically
  1054.    these  are  accounting and auditing. There is also  scope
  1055.    for  development of local tools. In this section, I  will
  1056.    outline  the  use  of  the  standard  facilities,   while
  1057.    homegrown  mechanisms  will be  considered  in  the  next
  1058.    section.
  1059.    
  1060.    Firstly,  it  will  be useful to have  a  brief  look  at
  1061.    accounting and auditing. System accounting is a  facility
  1062.    for  recording information about the use of  the  machine
  1063.    from a normal system accounting perspective, whereas  the
  1064.    system  audit  logger  records similar  information,  but
  1065.    from a system security perspective. Both of these can  be
  1066.    used  to  construct audit trails of activity. Information
  1067.    from  the  system  audit logger can be gleaned  not  only
  1068.    from  the audit journal, but also from the operator  log,
  1069.    as the auditor also sends it's messages to OPCOM.
  1070.    
  1071.    Consider,  for  example,  a situation  in  which  a  user
  1072.    (USER1) has made a modification to USER2's entry  in  the
  1073.    User Authorization File.
  1074.    
  1075.    The audit logger returns the following information:
  1076.    
  1077.     Security alarm (SECURITY) and security audit (SECURITY) on NODE1,
  1078.         system id: 1072 / System UAF record modification
  1079.     Event time:            27-JUL-1993 12:15:17.47
  1080.     PID:                   0000005F
  1081.     Username:              USER1
  1082.     Image name:            NODE1$DKA0:[SYS0.SYSCOMMON.][SYSEXE]AUTHORIZE.EXE
  1083.     Object name:           SYS$COMMON:[SYSEXE]SYSUAF.DAT;1
  1084.     Object type:           file
  1085.     User record modified:  USER2
  1086.     Fields modified:       FLAGS,PRIVILEGES
  1087.    
  1088.    
  1089.    The accounting facility contains this:
  1090.    
  1091.    AUTHORIZE Image Termination
  1092.    ---------------------------
  1093.    Username:         USER1       UIC:               [STAFF,USER1]
  1094.    Account:       STAFF       Finish time:       27-JUL-1993 12:15:27.79
  1095.    Process ID:    0000005F    Start time:        27-JUL-1993 12:14:51.23
  1096.    Owner ID:                  Elapsed time:      0 00:00:36.56
  1097.    Terminal name: RTA1:       Processor time:    0 00:00:00.22
  1098.    Remote node addr: 1038     Priority:          4
  1099.    Remote node name: NODE2    Privilege <31-00>: 10148001
  1100.    Remote ID:     USER2       Privilege <63-32>: 00000040
  1101.    Queue entry:               Final status code: 00000001
  1102.    Queue name:
  1103.    Job name:
  1104.    Final status text: %SYSTEM-S-NORMAL, normal successful completion
  1105.    
  1106.    Page faults:      238         Direct IO:         32
  1107.    Page fault reads:   9         Buffered IO:       58
  1108.    Peak working set: 631         Volumes mounted:   0
  1109.    Peak page file:  1166         Images executed:   244
  1110.    Image name: NODE1$DKA0:[SYS0.SYSCOMMON.][SYSEXE]AUTHORIZE.EXE
  1111.    
  1112.    
  1113.    Both  facilities  tell us that USER1  ran  the  AUTHORIZE
  1114.    utility  successfully under PID 5F at 12:15 pm on 27-Jul-
  1115.    1993.  From the accounting, we can see at a glance  where
  1116.    USER1  logged in from. The audit logger tells us  exactly
  1117.    what USER1 did whilst running this utility.
  1118.    
  1119.    Consider  another  example, in which a  computer  cracker
  1120.    has  logged in from an X.25 network address in an attempt
  1121.    to  maintain anonymity. The audit server has recorded the
  1122.    following information in the operator log:
  1123.    
  1124.    %%%%%%%%%%%  OPCOM  27-Jul-1993 19:38:23.60  %%%%%%%%%%%
  1125.    Message from user AUDIT$SERVER on NODE1
  1126.    Security alarm (SECURITY) and security audit (SECURITY) on NODE1,
  1127.      system id: 1038
  1128.    Auditable event:    Dialup interactive login
  1129.    Event time:         27-Jul-1993 19:38:23.59
  1130.    PID:                20205316
  1131.    Username:           USER1
  1132.    Terminal name:      _VTA1514 ({X.25 address deleted})
  1133.    
  1134.    
  1135.    The  system accounting record from the same user  logging
  1136.    out returns the following information:
  1137.    
  1138.    LOGINOUT Image Termination
  1139.    --------------------------
  1140.    Username:      USER1       UIC:  [STAFF,USER1]
  1141.    Account:       STAFF       Finish time:     27-Jul-1993 03:36:17.69
  1142.    Process ID:    20205316    Start time:      27-Jul-1993 19:38:07.19
  1143.    Owner ID:                  Elapsed time:              0 07:58:10.50
  1144.    Terminal name: VTA1514     Processor time:            0 00:00:46.14
  1145.    Remote node addr:          Priority:                              4
  1146.    Remote node name:          Privilege <31-00>:              00108000
  1147.    Remote ID:                 Privilege <63-32>:              00000000
  1148.    Queue entry:               Final status code:              00000001
  1149.    Queue name:
  1150.    Job name:
  1151.    Final status text: %SYSTEM-S-NORMAL, normal successful completion
  1152.  
  1153.    Page faults:       4716        Direct IO:            20927
  1154.    Page fault reads:   208        Buffered IO:          85056
  1155.    Peak working set:   970        Volumes mounted:      0
  1156.    Peak page file:    4813        Images executed:      28
  1157.    Image name: NODE1$DKA0:[SYS0.SYSCOMMON.][SYSEXE]LOGINOUT.EXE
  1158.    
  1159.    
  1160.    The  two  records act as a useful cross  check  for  each
  1161.    other.  The  audit  logger shows the  X.25  address  from
  1162.    which the user logged in from (which is not available  in
  1163.    this  accounting record). The accounting  facility  shows
  1164.    the  length of time that the user was on the system. When
  1165.    this  information is collated with the network accounting
  1166.    information,  then  the  cost of the  connection  can  be
  1167.    calculated. Furthermore the accounting records and  audit
  1168.    records can be examined to aid in determining the  extent
  1169.    of the damage caused by the attacker.
  1170.    
  1171.    3.1 Accounting
  1172.    
  1173.    Confirm that required system accounting is enabled thus:
  1174.    
  1175.     $  SET ACCOUNTING /ENABLE[=(Keyword...)]
  1176.    
  1177.    The  command  above enables logging of all activities  on
  1178.    the  system  in  the accounting file. Accounting  can  be
  1179.    enabled to log the following activities.
  1180.    
  1181.         PROCESS               any process termination
  1182.         IMAGE                 image execution
  1183.         INTERACTIVE           interactive job termination
  1184.         LOGIN_FAILURE         login failures
  1185.         SUBPROCESS            subprocess termination
  1186.         DETACHED              detached job termination
  1187.         BATCH                 batch job termination
  1188.         NETWORK               network job termination
  1189.         PRINT                 all print jobs
  1190.         MESSAGE               user messages
  1191.    
  1192.    
  1193.    Each  day,  a  new accounting file should be  created  in
  1194.    order  to keep the accounting files of a manageable size,
  1195.    using the command -
  1196.    
  1197.     $ SET ACCOUNTING /NEW_FILE
  1198.    
  1199.  
  1200.    
  1201.    
  1202.    3.2 Auditing
  1203.    
  1204.    The  auditor  can  be  configured to  log  the  following
  1205.    events:
  1206.    
  1207.         ACL                 Event requested by an Access Control List Item
  1208.         AUTHORIZATION       Modification of the system user authorization file
  1209.         BREAKIN             Occurrence of a breakin attempt 
  1210.                              (from various sources)
  1211.         FILE_ACCESS         File or global section access
  1212.                              (by various methods)
  1213.         INSTALL             Occurrence of any INSTALL operation
  1214.         LOGFAILURE          Occurrence of a login failure
  1215.                              (from various sources)
  1216.         LOGIN               A login attempt (from various sources)
  1217.         LOGOUT              Occurrence of a logout
  1218.         MOUNT               Issuance of a mount or dismount request
  1219.    
  1220.    This  is  done  using  SET AUDIT /ENABLE=(keyword[,...]).
  1221.    The  /ALARM qualifier is also used to raise an  alarm  to
  1222.    all terminals enabled as security operators.
  1223.    
  1224.    You  can  examine the configuration of your system  audit
  1225.    server  using SHOW AUDIT /ALL. The categories that should
  1226.    be   carefully   considered  are  the   auditing   server
  1227.    characteristics, the alarm failure mode, and the  enabled
  1228.    security alarms.
  1229.    
  1230.    Note  that  within  the auditing server  characteristics,
  1231.    the  default final resource action is to crash the system
  1232.    if  the  system  runs out of virtual memory.  This  means
  1233.    that  if  the  disk containing the audit journal  log  is
  1234.    full, the system will crash, thus exposing the system  to
  1235.    denial  of  service attacks. When configuring  the  audit
  1236.    server,  you should carefully consider the final resource
  1237.    action  parameter.  It can be set  using  the  SET  AUDIT
  1238.    command.
  1239.  
  1240.     $ SET AUDIT /SERVER=FINAL_ACTION=action
  1241.  
  1242.    (where  action  can  be  one  of  CRASH,  IGNORE_NEW   or
  1243.    PURGE_OLD)
  1244.  
  1245.    As  with system accounting, a new audit journal should be
  1246.    created each day:
  1247.    
  1248.     $ SET AUDIT /SERVER=NEW_LOG
  1249.    
  1250.    
  1251.  
  1252.    
  1253.    3.3 FAL and Poor Man's Routing
  1254.    
  1255.    In  order  to  properly explain the step  taken  in  this
  1256.    phase,  it  is  necessary to understand what  Poor  Man's
  1257.    Routing  is,  and how it is linked with the  File  Access
  1258.    Listener (FAL) object and the logical FAL$LOG.
  1259.    
  1260.    The  FAL  object  (File Access Listener)  is  the  DECnet
  1261.    object that allows a remote user to access files on  your
  1262.    node.  It  can  be used to browse your node,  or  perform
  1263.    file  transfers. For legitimate users, this is  extremely
  1264.    useful  - unfortunately, people with malintent also  find
  1265.    it useful if your system is not protected.
  1266.    
  1267.    In  the  context  of  DECnet networking  operations  (and
  1268.    specifically  FAL), "Poor Man's Routing (PMR)  refers  to
  1269.    the  technique  of  supplying an  explicit  path  to  the
  1270.    required  target,  rather  than letting  assigned  DECnet
  1271.    routers  pick the most optimal path" [Tencati]. When  PMR
  1272.    is  used,  a process is created on each node in the  path
  1273.    to  forward the connection to the next node in the  path.
  1274.    Each  of  these  nodes (including the  destination  node)
  1275.    only  sees the connection from it's path predecessor.  It
  1276.    is   therefore  very  difficult  to  ascertain  from  the
  1277.    destination node where the connection originated from.
  1278.    
  1279.    The  legitimate use of this is in cases where the  source
  1280.    node  may  not  know  anything  about  the  remote  note.
  1281.    Unfortunately,  people  with  malintent   can   use   the
  1282.    properties  described above to create a  convoluted  path
  1283.    to  the  node  they wish to attack (possibly via  several
  1284.    timezones and countries) to hide themselves effectively.
  1285.    
  1286.    PMR  can  also  be  used to defeat the hiding  of  DECnet
  1287.    subnets. There is a parameter in the NCP database  called
  1288.    the  maximum  area  (see NCP> HELP SET  EXECUTOR  MAXIMUM
  1289.    AREA).  This parameter specifies the largest area  number
  1290.    known  to an executor's routing layer. If used carefully,
  1291.    this  parameter can be used to hide subnets. PMR  can  be
  1292.    used  to  circumvent this technique if the  attacker  has
  1293.    appropriate  information about your network design.  (The
  1294.    lesson  here is to never trust security through obscurity
  1295.    -  always  rely on robust, proactive methods rather  than
  1296.    ignorance.) Ron Tencati's Managing Security in  a  Multi-
  1297.    Vendor  Network gives a good explanation of PMR, and  the
  1298.    use of Area Routing.
  1299.    
  1300.    You  can  configure  FAL  by use of  the  logical  symbol
  1301.    FAL$LOG. In the machine used in the preparation  of  this
  1302.    paper, this logical was configured to do two things:
  1303.      
  1304.      * refuse connections made by PMR
  1305.      * supply   audit  trail  information  in  NETSERVER.LOG
  1306.        files in the case of successful FAL connections.
  1307.    
  1308.    The  logical name FAL$LOG translates to a string  of  the
  1309.    form xx_yy where:
  1310.    
  1311.      * xx  is  a  hexadecimal number representing a longword
  1312.        string value
  1313.      * yy  is a hexadecimal number specifying how many bytes
  1314.        of  each  DAP message are to be displayed in the  log
  1315.        file (SYS$OUTPUT:).
  1316.    
  1317.    The hexadecimal flags are:
  1318.    
  1319.        0001 - log filename/function requests
  1320.        0002 - log throughput statistics
  1321.        0004 - log individual DAP messages
  1322.        0008 - log DAP message packet AST requests (logged at AST level)
  1323.        0010 - log DAP message packet QIO requests
  1324.        0020 - reserved
  1325.        0040 - disable DAP message blocking
  1326.        0080 - disable DAP CRC error checking
  1327.        
  1328.    In  SYS$MANAGER:SYLOGICALS.COM, FAL$LOG should be defined
  1329.    to  be  the character string "03/DISABLE=8" (See  Section
  1330.    2.4,   System  Logicals  And  Logical  Definitions).   By
  1331.    setting  this  logical to this value,  the  following  is
  1332.    achieved:
  1333.    
  1334.      * PMR is disabled ("/DISABLE=8")
  1335.      * filename/function requests and throughput  statistics
  1336.        are  logged (the setting "03" being  the addition  of
  1337.        "01" and "02"
  1338.    
  1339.    Consider  an  example where NODE1::USER1 is  executing  a
  1340.    directory on NODE2::USER2's home directory. In  the  file
  1341.    NETSERVER.LOG  in  USER2's directory, we  would  see  the
  1342.    following results.
  1343.    
  1344.    With no definition for FAL$LOG:
  1345.    
  1346.           --------------------------------------------------------
  1347.             Connect request received at 28-JUL-1993 15:36:45.78
  1348.                   from remote process NODE1::"0=USER1"
  1349.                   for object "SYS$COMMON:[SYSEXE]FAL.EXE"
  1350.           --------------------------------------------------------
  1351.                                  
  1352.    With   FAL$LOG   defined  to  be  "03/DISABLE=8",   extra
  1353.    information is appended:
  1354.    
  1355.          --------------------------------------------------------
  1356.          Connect request received at 28-JUL-1993 15:55:40.28
  1357.          from remote process NODE1::"0=USER1"
  1358.          for object "SYS$COMMON:[SYSEXE]FAL.EXE"
  1359.          --------------------------------------------------------
  1360.    
  1361.          ========================================================
  1362.          FAL V5.1-D3 started execution on 28-JUL-1993 15:55:41.12
  1363.          with SYS$NET = NODE1::"0=USER1" and with FAL$LOG = 03
  1364.          
  1365.          Logical link was established on  28-JUL-1993 15:55:41.13
  1366.          
  1367.          Requested file access operation: Directory List
  1368.          Specified file: DISKE:[USER2]L*.*;*
  1369.          Resultant file: DISKE:[USER2]LOGIN.COM;3
  1370.          Resultant file: DISKE:[USER2]LWK_PERSONAL.LINKBASE;1
  1371.          
  1372.          Logical link was terminated on   28-JUL-1993 15:55:41.18
  1373.          
  1374.          Total connect time for logical link was    0 00:00:00.05
  1375.          Total CPU time used for connection was     0 00:00:00.02
  1376.          
  1377.          File Access Statistics for RECV-Side XMIT-Side Composite
  1378.          -------------------------- --------- --------- --------
  1379.          # DAP Message QIO Calls            2         2         4
  1380.          # DAP Messages Exchanged           2        14        16
  1381.          # User Records/Blocks              0         0         0
  1382.          NETSERVER.LOG (continued)
  1383.          
  1384.          # Bytes of User Data               0         0         0
  1385.          # Bytes in DAP Layer              49       310       359
  1386.          User Data Throughput (bps)         0         0         0
  1387.          DAP Layer Throughput (bps)      7840     49600     57440
  1388.          Average Record/Block Size          0         0         0
  1389.          % User Data in DAP Layer        0.0%      0.0%      0.0%
  1390.          -------------------------- --------- --------- ---------
  1391.          
  1392.          Negotiated DAP buffer size           = 1060 bytes
  1393.          Buffered I/O count during connection = 13
  1394.          Direct I/O count during connection   = 0
  1395.          Peak working set size for process    = 470 pages
  1396.          
  1397.          Successful Start Transaction Branch  = 0
  1398.          Start Transaction Branch loops       = 0
  1399.          
  1400.          FAL terminated execution on      28-JUL-1993 15:55:41.21
  1401.          ========================================================
  1402.          
  1403.    
  1404.    
  1405.    
  1406.    
  1407.    
  1408.    
  1409.    
  1410.           Using Homegrown Or Publicly Available Software
  1411.    
  1412.    
  1413.    4.1 Wrappers
  1414.    
  1415.    A  "wrapper"  is  a  piece of software that  monitors  an
  1416.    attempt to use a service, and based on the details  about
  1417.    the  source of the attempt (such as remote host and user,
  1418.    time,  and connection type), determine whether  to  allow
  1419.    the  use of the service or not. This is the feature  that
  1420.    a  wrapper  has  available to it over and above  standard
  1421.    system  logging  software: the use of the  wrapper  gives
  1422.    the  system manager freedom to make decisions whether  to
  1423.    allow  the  use  of  the machine from a  remote  site  in
  1424.    addition to simply logging that use.
  1425.    
  1426.    Wrappers  should  be  constructed for  the  NML  and  FAL
  1427.    objects, and also for interactive logins. Section  2.1.2,
  1428.    SYLOGIN.COM and Section 2.3.2, Objects gives the  details
  1429.    on how to install these wrappers.
  1430.    
  1431.    Because  the  NML and FAL wrappers need to handle  DECnet
  1432.    connections   only,  they  are  more  simple   than   the
  1433.    interactive login wrapper.
  1434.    
  1435.    The  DECnet  object wrappers evaluate the  connection  by
  1436.    comparing the remote node and user combination against  a
  1437.    set  of  rules.  The  set of rules is  described  in  two
  1438.    files:
  1439.      AllowFile which describes which combinations  may  make
  1440.                the connection, and
  1441.      DenyFile  which describes which combinations  may  not
  1442.                make the connection.
  1443.    
  1444.    Wildcards are allowed. The general algorithm is:
  1445.  
  1446.      Main ()
  1447.      {
  1448.        RemoteUser = f$trnlnm("SYS$REM_ID")
  1449.        RemoteNode = f$trnlnm("SYS$REM_NODE")
  1450.        ConnectionOkay = CheckRules(RemoteNode, RemoteUser)
  1451.        if (ConnectionOkay = Allow) /* ConnectionOkay = Allow|Deny */
  1452.        then
  1453.          write successful connection record to wrapper log
  1454.          request/to=(network,security) "<Succesful connection details>"
  1455.          run SYS$SYSTEM:FAL.EXE
  1456.        else
  1457.          write failed connection record to wrapper log
  1458.          request/to=(network,security) "<Failed connection details>"
  1459.          logout
  1460.        endif
  1461.      } end Main
  1462.      CheckRules (RemoteNode, RemoteUser)
  1463.      {
  1464.        if ((result = CheckCombination(RemoteNode, RemoteUser)) != Unknown)
  1465.          then return result
  1466.        if ((result = CheckCombination(RemoteNode, "*"))        != Unknown)
  1467.          then return result
  1468.        if ((result = CheckCombination("*", "*"))               != Unknown)
  1469.          then return result
  1470.        return Deny
  1471.      }  end CheckRules
  1472.      CheckCombination (RemoteNode, RemoteUser)
  1473.      {
  1474.        Search AllowFile for RemoteNode::RemoteUser
  1475.        if found then return Allow
  1476.        Search DenyFile for RemoteNode::RemoteUser
  1477.        if found then return Deny
  1478.        return Unknown
  1479.      }  end CheckCombination
  1480.    
  1481.    The  search  commands used above should be  such  that  a
  1482.    wildcard  search matches the literal "*" in a  file,  not
  1483.    any  string  (in  a  similar manner to the  VMS  "SEARCH"
  1484.    command).  Hence the wildcard value of "*" is  placed  in
  1485.    the  file  by the system manager. The general  philosophy
  1486.    that  should  be  adopted is to use a blanket  denial  (a
  1487.    single  line  of "*::*" in the deny file)  with  specific
  1488.    allowed node::user combinations in the allow file.
  1489.    
  1490.    The  interactive connection wrapper is similar, with only
  1491.    a slightly more complicated top level algorithm:
  1492.    
  1493.      Main ()
  1494.      {
  1495.    |    Establish RemoteUser
  1496.    |    Establish RemoteNode
  1497.         ConnectionOkay = CheckRules(RemoteNode, RemoteUser)
  1498.         if (ConnectionOkay = Allow) /* ConnectionOkay = Allow|Deny */
  1499.         then
  1500.           write successful connection record to wrapper log
  1501.           request/to=(network,security) "<Succesful connection details>"
  1502.    |      exit(Success)
  1503.         else
  1504.           write failed connection record to wrapper log
  1505.           request/to=(network,security) "<Failed connection details>"
  1506.    |      exit(Failure)
  1507.         endif
  1508.      } end Main
  1509.    
  1510.    The  main  problem here is to establish remote  user  and
  1511.    node  identities. Interactive access may take place using
  1512.    DECnet,  LAT,  TCP/IP and so on. System  values  used  to
  1513.    find this information are:
  1514.    
  1515.      * F$TRNLNM("SYS$REM_ID")
  1516.      * F$TRNLNM("SYS$REM_NODE")
  1517.      * F$GETDVI("SYS$COMMAND","TT_ACCPORNAM")
  1518.      * the DECnet database
  1519.      * the local terminal type of the connection
  1520.      * information from F$TRNLNM("DECW$DISPLAY")
  1521.    
  1522.    Connections  are then evaluated not only on  remote  node
  1523.    and  user (if provided by the protocol), but also by  the
  1524.    protocol    used   for   the   connection    and    local
  1525.    characteristics (such as the time).
  1526.    
  1527.    It  is  important to note that any reading from AllowFile
  1528.    or  DenyFile,  and writing to the wrapper log  should  be
  1529.    carried out by installed, protected images, and that  the
  1530.    command  file(s)  and executable(s)  used  are  writeable
  1531.    only   by   system  privileged  accounts.  This  prevents
  1532.    modification  of  behaviour  and  recorded   results   by
  1533.    potential attackers.
  1534.    
  1535.    Example  code and configuration files appear in  Appendix
  1536.    3, Wrapper Example.
  1537.    
  1538.  
  1539.  
  1540.  
  1541.    4.2 Single Use PINs
  1542.    
  1543.    A  Personal  Identification Number (PIN)  is  simply  the
  1544.    numerical equivalent of a text-based password.  Unlike  a
  1545.    normal  password system, though, a single use PIN  relies
  1546.    on   algorithmic  knowledge  rather  than  static   value
  1547.    knowledge.
  1548.    
  1549.    The  system  works thus: when a user logs in, system  and
  1550.    user  passwords must be supplied as described in previous
  1551.    sections. A numerical challenge is then issued. The  user
  1552.    must  supply the correct reply to this challenge, or  the
  1553.    login   will  be  denied.  The  correct  reply  is   some
  1554.    permutation  of  the  original challenge.  The  challenge
  1555.    must  be randomly generated, so that every time the  user
  1556.    logs  in,  a  different numerical challenge is  supplied,
  1557.    requiring  a  unique reply - only the algorithm  used  to
  1558.    deduce   the   reply  from  the  challenge   is   static.
  1559.    Furthermore, this algorithm is different for  each  user.
  1560.    The  software which issues the challenge and receives the
  1561.    reply  must be robust, so that an attacker cannot  simply
  1562.    "crash" the software and hence bypass this mechanism.
  1563.    
  1564.    Such systems are available commercially. A smart-card  is
  1565.    usually  supplied with such systems. The  user  keys  the
  1566.    challenge  supplied by the host into the smartcard  using
  1567.    the  keypad.  The smartcard then displays  the  response,
  1568.    and the user enters this as the reply to the host.
  1569.    
  1570.    A  cheaper alternative is to write such a system locally,
  1571.    fulfilling all of these criteria. A usage policy must  be
  1572.    in place to effectively manage this system.
  1573.    
  1574.    
  1575.    
  1576.    4.3 Terminal Monitors
  1577.    
  1578.    Terminal  monitors  are  useful utilities  for  providing
  1579.    help to users who may be working remotely, or may not  be
  1580.    reachable by telephone and require some type of  help  in
  1581.    real-time (i.e. electronic mail would not suffice).
  1582.    
  1583.    Where  such  utilities are available on the system,  they
  1584.    must  be adequately protected to ensure that unauthorised
  1585.    users  can neither use them nor copy them. Care  must  be
  1586.    taken  to  ensure that explicit permission is  sought  by
  1587.    the  legitimate  users concerned or a relevant  authority
  1588.    when such a utility is used.
  1589.    
  1590.    Similar  principles apply when using system software  for
  1591.    capturing  a process's recall buffer in order to  examine
  1592.    the commands issued by that process.
  1593.    
  1594.    
  1595.        
  1596.                                  
  1597.                                  
  1598.                                  
  1599.                                  
  1600.                                  
  1601.                  Monitoring The Use Of The Machine
  1602.    
  1603.    
  1604.    It  is  essential to carry out monitoring on any  machine
  1605.    in  order  to  evaluate  the health  of  the  system.  In
  1606.    addition  to  checks  that should be  carried  out  on  a
  1607.    regular  basis,  steps should be taken to  be  allow  for
  1608.    investigation of unusual security related events as  soon
  1609.    as possible.
  1610.    
  1611.    
  1612.    
  1613.    5.1 The SHOW INTRUSION Command
  1614.    
  1615.    Use  the  command SHOW INTRUSION regularly. This  command
  1616.    displays   the   contents  of  the   break-in   database,
  1617.    providing  a quick technique for checking if  there  have
  1618.    been  attempts to break into your system in the immediate
  1619.    past.
  1620.    
  1621.    When  using  the SHOW INTRUSION command, you  must  first
  1622.    get  some  idea  if the host has detected  any  potential
  1623.    breakins:
  1624.    
  1625.     $ SET PROC/PRIV=(CMKRNL,SYSPRV)
  1626.     $ SHOW INTRUSION
  1627.     Intrusion       Type       Count  Expiration   Source
  1628.     NETWORK       SUSPECT       6    16:32:23.03   NODE2::USER2
  1629.     TERM_USER     SUSPECT       3    16:18:14.16   USER1
  1630.    
  1631.    
  1632.    In  this  case,  there  are two  suspect  incidents.  The
  1633.    records  below  show that the first  was  an  attempt  by
  1634.    USER2  on node NODE2 to login as USER1 on the local  host
  1635.    (NODE1) via DECnet. The second is an attempt to login  as
  1636.    USER1  on  the local host using telnet from NODE3  (which
  1637.    in this case was actually the localhost - 127.0.0.1).
  1638.    
  1639.    The accounting records show the following:
  1640.    
  1641.    LOGIN FAILURE
  1642.    -------------
  1643.    Username:      USER1         UIC:            [SYSTEM]
  1644.    Account:       <login>       Finish time:    3-AUG-1993 16:02:28.80
  1645.    Process ID:    2080D073      Start time:     3-AUG-1993 16:02:19.59
  1646.    Owner ID:                    Elapsed time:            0 00:00:09.21
  1647.    Terminal name: RTA3:         Processor time:          0 00:00:00.23
  1648.    Remote node addr: 1038       Priority:                            4
  1649.    Remote node name: NODE2      Privilege <31-00>:            0010C000
  1650.    Remote ID:     USER2         Privilege <63-32>:            00000000
  1651.    Queue entry:                 Final status code:            10D380FC
  1652.    Queue name:
  1653.    Job name:
  1654.    Final status text: %LOGIN-F-INVPWD, invalid password
  1655.  
  1656.    Page faults:             234    Direct IO:                 24
  1657.    Page fault reads:          5    Buffered IO:               40
  1658.    Peak working set:        287    Volumes mounted:            0
  1659.    Peak page file:         1474    Images executed:            1
  1660.    
  1661.    
  1662.    LOGIN FAILURE
  1663.    -------------
  1664.    Username:      USER1         UIC:            [SYSTEM]
  1665.    Account:       <login>       Finish time:    3-AUG-1993 16:03:20.85
  1666.    Process ID:    2080D878      Start time:     3-AUG-1993 16:03:11.77
  1667.    Owner ID:                    Elapsed time:            0 00:00:09.08
  1668.    Terminal name: VTA3959       Processor time:          0 00:00:00.21
  1669.    Remote node addr:            Priority                             4
  1670.    Remote node name:            Privilege <31-00>:            FFFFFFFF
  1671.    Remote ID:                   Privilege <63-32>:            FFFFFFFF
  1672.    Queue entry:                 Final status code:            10D380FC
  1673.    Queue name:
  1674.    Job name:
  1675.    Final status text: %LOGIN-F-INVPWD, invalid password
  1676.  
  1677.    Page faults:             235    Direct IO:                 18
  1678.    Page fault reads:          5    Buffered IO:               41
  1679.    Peak working set:        284    Volumes mounted:            0
  1680.    Peak page file:         1474    Images executed:            1
  1681.    
  1682.    
  1683.    The audit records show the following:
  1684.    
  1685.    
  1686.    Security alarm (SECURITY) and security audit (SECURITY) on NODE1,
  1687.    system id: 1072 / Remote interactive login failure
  1688.    Event time:    3-AUG-1993 16:02:19.59
  1689.    PID:                00000D33
  1690.    Username:           USER1
  1691.    Terminal name:      _RTA1:
  1692.    Remote nodename:    NODE2           Remote node id:         1184
  1693.    Remote username:    USER2
  1694.    Status:             %LOGIN-F-INVPWD, invalid password
  1695.    
  1696.  
  1697.    Security alarm (SECURITY) and security audit (SECURITY) on NODE1,
  1698.    system id: 1072 / Remote interactive login failure
  1699.    Event time:    3-AUG-1993 16:03:11.77
  1700.    PID:                00000CB4
  1701.    Username:           USER1
  1702.    Terminal name:      _TNA7:
  1703.    Remote nodename:    127.0.          Remote node id:   2130706433
  1704.    Remote username:    TELNET_7F000001
  1705.    Status:             %LOGIN-F-INVPWD, invalid password
  1706.    
  1707.    
  1708.    Note that the remote nodename is always truncated to  six
  1709.    characters.   The   remote  node  id   is   a   numerical
  1710.    representation of the remote address.
  1711.    
  1712.    Notice  from  the  failed telnet  login  above  that  the
  1713.    remote   username  is  given  as  TELNET_7F000001.   This
  1714.    equates to the IP address 127.0.0.1 thus:
  1715.    
  1716.         7 * 16 + F = 127
  1717.         0 * 16 + 0 =   0
  1718.         0 * 16 + 0 =   0
  1719.         0 * 16 + 1 =   1
  1720.    
  1721.    Hence   if  this  attempt  had  come  from  the   Network
  1722.    Information   Centre   (nic.ddn.mil,   Internet   address
  1723.    192.112.36.5),  the remote username would  have  appeared
  1724.    TELNET_C0702405.
  1725.    
  1726.    
  1727.  
  1728.    
  1729.    5.2 Daily Activities
  1730.    
  1731.    A  batch  file  must  be written in order  to  carry  out
  1732.    regular  activities  on  a  daily  basis.  Amongst  these
  1733.    activities  should be various checks on log files.  These
  1734.    are listed below.
  1735.    
  1736.     $ SEARCH/OUTPUT=BREAKIN_CHECK.TMP SYS$MANAGER:OPERATOR.LOG;-1 -
  1737.      "Security alarm"/WINDOW=(3,8)
  1738.     $ ANALYZE/AUDIT/BRIEF/SUMMARY/NOINTERACTIVE/OUTPUT=BREAKIN_CHECK.TMP -
  1739.      SYS$MANAGER:SECURITY_AUDIT.AUDIT$JOURNAL;-1
  1740.     $ ACCOUNT/LOG/SORT=(TYPE,STARTED)/OUTPUT=BREAKIN_CHECK.TMP  ACCOUNTNG;-1
  1741.    
  1742.    
  1743.    Any  one  of  these can be used for obtaining information
  1744.    about  the  life of the system. The amount  and  type  of
  1745.    information  required should be used to determine  which.
  1746.    When  any  record from the output of these files  reveals
  1747.    an  incident that appears unusual, then further  checking
  1748.    is  required. The daily summary returned by  any  one  of
  1749.    the  commands above should only be used to indicate  that
  1750.    this  action  is required - you should not rely  on  just
  1751.    the summary information returned by these commands.
  1752.    
  1753.     $ SHOW AUDIT/ALL/OUTPUT=AUDIT_CHECK.TMP 
  1754.    
  1755.    Check  daily  that the security auditing  characteristics
  1756.    you require are in place, and have not been changed.
  1757.    
  1758.     $ ANALYZE/ERROR/SINCE="-1 0:0:0.0"/OUTPUT=ERROR_CHECK.TMP
  1759.    
  1760.    Examine  the  error  log daily as  well.  This  will  not
  1761.    necessarily  alert  you to a security  incident,  but  it
  1762.    will  draw  your  attention to any system  problems  that
  1763.    could  potentially hinder your efforts  to  recover  from
  1764.    disaster.  (You  could also put the "SHOW ERROR"  command
  1765.    in your LOGIN.COM file.)
  1766.    
  1767.     $ MAIL/NOSELF/NOEDIT LOCAL$WRAP:INTERACTIVE.LOG -
  1768.       "@SYS$SYSROOT:[SYSMGR.MAIL]DAILY_BATCH.DIS" -
  1769.       /SUBJECT:"Logged interactive logins"
  1770.    
  1771.    Wrappers  were  discussed in Section  4.1,  Wrappers.  As
  1772.    part   of  your  daily  checking,  you  should  mail   to
  1773.    yourself,  and  other  relevant users,  the  output  from
  1774.    these  wrappers  on  a  daily basis.  The  example  above
  1775.    mentions only output from the interactive wrapper  log  -
  1776.    the implication is that all logs should be checked.
  1777.    
  1778.  
  1779.    
  1780.    
  1781.    5.3 Having a Live Console
  1782.    
  1783.    Don't   rely   simply   on   on-line   sinks   (such   as
  1784.    OPERATOR.LOG) for your security oriented output.  In  the
  1785.    event of a system compromise, it is quite likely that  an
  1786.    attacker will attempt to delete or modify information  in
  1787.    system files.
  1788.    
  1789.    A  good idea is to enable a security operator's terminal.
  1790.    In  addition  to (or even instead of) the  normal  system
  1791.    console  (usually  OPA0:), you should  consider  using  a
  1792.    security  operator's terminal one that provides  hardcopy
  1793.    output and is located in a secure location.
  1794.    
  1795.    (A  word  of  caution: even an unsuccessful attack  could
  1796.    seriously  disrupt  your system if the  hardcopy  printer
  1797.    runs out of paper.)
  1798.    
  1799.    Using  the example from the Guide to VMS System  Security
  1800.    manual,   consider  an  example  where  such  a  terminal
  1801.    (TTA3:)  has  been designated, and security messages  are
  1802.    to  be  disabled  on the console. This  can  be  achieved
  1803.    thus:
  1804.    
  1805.     $ DEFINE/USER SYS$COMMAND OPA0:
  1806.     $ REPLY/DISABLE=SECURITY
  1807.     $ DEFINE/USER SYS$COMMAND TTA3:
  1808.     $ REPLY/ENABLE=SECURITY
  1809.    
  1810.    You  can, of course, enable other message classes to this
  1811.    terminal as well.
  1812.                                  
  1813.                                  
  1814.                                  
  1815.                                  
  1816.                                  
  1817.                                  
  1818.                                  
  1819.                                  
  1820.                          Acknowledgements
  1821.                                  
  1822.                                  
  1823.                                  
  1824.    Most  of  the undocumented material in this  paper  is  a
  1825.    mixture  of my own work and other material that has  been
  1826.    passed  on  to me by various colleagues at The University
  1827.    Of  Queensland.  The original idea for  the  wrapper  was
  1828.    inspired  by  Ron  Tencati, and  Wietse  Venema's  public
  1829.    domain tcp_wrapper for UNIX systems.
  1830.                                  
  1831.                                  
  1832.                                  
  1833.                                  
  1834.                                  
  1835.                                  
  1836.                                  
  1837.                                  
  1838.                             References
  1839.                                  
  1840.                                  
  1841.    VAX/VMS Documentation manuals:
  1842.    
  1843.        DEC TCP/IP Services for VMS System Management
  1844.        Guide to VAX/VMS System Security
  1845.        Access Control List Editor Utility
  1846.        Accounting Utility
  1847.        Audit Analysis Utility
  1848.        Authorize Utility
  1849.        Guide to Maintaining a VMS System
  1850.        Network Control Program Manual
  1851.        Networking Manual
  1852.                                  
  1853.                                  
  1854.                                  
  1855.    Ron Tencati, Ken Coar and E Eugene Schultz
  1856.    
  1857.        Managing Security in a Multi-Vendor Network, 1992
  1858.        
  1859.        
  1860.        
  1861.        
  1862.    
  1863.    
  1864.    
  1865.    
  1866.                                  Appendix 1
  1867.                                  
  1868.                                  
  1869.                 SERT Advisory SA-93.03, Suggested Login Banner
  1870.  
  1871.                  
  1872. =============================================================================
  1873. SA-93:03A            SERT Advisory
  1874.                  31-May-1993
  1875.                 Suggested Login Banner
  1876. -----------------------------------------------------------------------------
  1877.  
  1878. On 7-May-1993, the Security Emergency Response Team released Advisory
  1879. SA-93:03.  Since then, it has been brought to our attention that the word
  1880. "permission" could be considered ambiguous as Unix file systems use
  1881. "permission" bits to specify if access is granted to a file or not.
  1882.  
  1883. Further advice from the Commonwealth Director of Public Prosecutions
  1884. indicates:
  1885.  
  1886. "'Permit' does seem to include a meaning of 'allow or let happen even by
  1887. accident or carelessness'."
  1888.  
  1889. "'Authority' or 'authorisation' suggest that someone has deliberately
  1890. turned their mind to an action and formally approved that action."
  1891.  
  1892. "In light of the fact that there does appear to be a difference in meaning
  1893. between words 'permit or permission' and 'authority or authorisation' and
  1894. the fact that computer scientists refer to 'permission' bits on Unix files,
  1895. it does appear desirable that the words 'authority' or 'authorisation' be
  1896. used instead of the word 'permission'."
  1897.  
  1898. Therefore, the Security Emergency Response Team has reissued SA-93:03 as
  1899. SA-93:03A taking into account the new recommendations.  The new Advisory is
  1900. included below.
  1901.  
  1902. ----------------------------------------------------------------------------
  1903. The SERT team wishes to thank Kate Lance at the University of Newcastle for
  1904. bringing this problem to our attention.
  1905. ----------------------------------------------------------------------------
  1906.  
  1907. ----------------------------------------------------------------------------
  1908. Body of SERT Advisory SA-93:03A
  1909. ----------------------------------------------------------------------------
  1910.  
  1911. The Security Emergency Response Team has received information that a
  1912. successful prosecution of a computer cracker has taken place in New South
  1913. Wales.  The prosecution was aided by the use of an appropriate login
  1914. banner.  The following is an extract from a letter by the Australian
  1915. Federal Police:
  1916.  
  1917. "A major factor, commented upon by the magistrate, was the repeated warning
  1918. message displayed at logon to your system.  Your agreement to implement this
  1919. feature has certainly started to pay dividends and demonstrates a certain
  1920. willingness to accept [that] tertiary institutions are not fair game."
  1921.  
  1922. A recommended login banner is:
  1923.  
  1924. ----- Warning Message -----
  1925.  
  1926.     ***** This service is for authorised clients only *****
  1927.  
  1928. ****************************************************************************
  1929. * WARNING:    It is a criminal offence to:                   *
  1930. *        i. Obtain access to data without authority           *
  1931. *            (Penalty 2 years imprisonment)               *
  1932. *        ii Damage, delete, alter or insert data without authority  *
  1933. *            (Penalty 10 years imprisonment)               *
  1934. ****************************************************************************
  1935.  
  1936. This example login banner was supplied to the Australian Federal Police by
  1937. the office of the Commonwealth Director of Public Prosecutions.  Legal
  1938. opinion from the Commonwealth Director of Public Prosecutions indicates
  1939. that this warning will assist in prosecutions of computer crackers for two
  1940. reasons:
  1941.  
  1942. "The prosecution in a criminal case must show that the computer hacker's
  1943. actions are intentional.  It would be extremely difficult for a hacker to
  1944. argue that his actions were by accident or inadvertent when he has to go
  1945. past such a warning on the system."
  1946.  
  1947. "A hacker may admit that his actions were intentional.  However, upon his
  1948. sentence, he may argue that he was ignorant of the law or that he was
  1949. unaware that his actions were unauthorised, thereby inducing the court to
  1950. mitigate the penalty that it imposes.  If the above warning is used, it
  1951. will be extremely difficult for a hacker to present such arguments."
  1952.  
  1953. SERT recommends the use of this, or similar banners on ALL systems and
  1954. access points into the network (such as a modem pool and ftp access).  This
  1955. not only provides forewarning to any crackers that may intrude your system
  1956. that certain types of activity are illegal, but also advises any legitimate
  1957. users of their obligations relating to acceptable use of the computer
  1958. system.
  1959.  
  1960. The warning is deliberately general in nature as it has not yet been
  1961. established what type of (if any) crime has been committed.  Subsequent
  1962. prosecution may be performed under Federal or State law, or handled by
  1963. local institution disciplinary procedures.
  1964.  
  1965. SERT recommends that any login banner or system initial message should not
  1966. imply consent to use the computer services (E.g., words such as "greeting"
  1967. or "welcome"), unless it is the express intention that any user is free to
  1968. use the system, whether they are authorised or not.
  1969.  
  1970. You may wish to include some identification information (such as the
  1971. hostname) so that genuine users know that they have connected to the
  1972. correct system.  For example,
  1973. "You have connected to node FRED at The University of Wooloomooloo"
  1974. and follow this with an appropriate warning message.
  1975.  
  1976. Examples methods for login messages are:
  1977.  
  1978. VMS:    Edit the file SYS$MANAGER:SYSTARTUP_V5.COM and include the line:
  1979. $DEFINE/SYSTEM SYS$ANNOUNCE "@SYS$MANAGER:ANNOUNCE.TXT"
  1980. then create the file SYS$MANAGER:ANNOUNCE.TXT with the text that you wish
  1981. displayed when a user connects to your system.
  1982.  
  1983. Note that this has implications for LAT as the default service
  1984. identification is the logical SYS$ANNOUNCE (which will translate to
  1985. @SYS$MANAGER:ANNOUNCE.TXT).  In this case, you should edit the LAT startup
  1986. procedures to explicitly define a LAT service identification.
  1987.  
  1988. Unix:    Edit the "message of the day" file, (e.g., /etc/motd) and include
  1989. the text that you wish displayed when a user logs in to your system.
  1990.  
  1991. This does not cover all ways to connect to a computer (e.g., rlogin,
  1992. telnet, SET HOST, ftp), but serves as one point of warning in a number of
  1993. cases.  Warnings such as this are a positive step towards providing
  1994. adequate notice of the obligations and responsibilities relating to the use
  1995. of the computer equipment.  If a person is known to have seen the warning,
  1996. they cannot subsequently claim ignorance of their responsibilities.
  1997.  
  1998. ----------------------------------------------------------------------------
  1999. The SERT team wishes to thank The University of Sydney, the University of
  2000. South Australia, the Australian Federal Police, and the Commonwealth
  2001. Director of Public Prosecutions for their advice and cooperation in this
  2002. matter.
  2003. ----------------------------------------------------------------------------
  2004.  
  2005. If you believe that your system has been compromised, contact SERT or your
  2006. representative in FIRST (Forum of Incident Response and Security Teams).
  2007.  
  2008. Internet Email:    sert@sert.edu.au
  2009. Facsimile:    (07) 365 4477
  2010. Telephone:    (07) 365 4417
  2011.         SERT personnel answer during business hours (AEST).
  2012.  
  2013. Security Emergency Response Team
  2014. Prentice Centre
  2015. The University Of Queensland
  2016. Qld.  4072.
  2017.    
  2018.    
  2019.    
  2020.    
  2021.    
  2022.                             Appendix 2
  2023.                 
  2024.  
  2025. SERT Advisory SA-93.04, Guidelines For Developing A Sensible Password Policy
  2026.                  
  2027.                                  
  2028.                                  
  2029. =============================================================================
  2030. SA-93:04                        SERT Advisory
  2031.                                   1-Jun-1993
  2032.              Guidelines For Developing A Sensible Password Policy
  2033. -----------------------------------------------------------------------------
  2034.  
  2035. This advisory contains guidelines for developing a sensible password policy. 
  2036. Please feel free to extract the contents of this advisory, modify to suit local 
  2037. conditions, and then distribute to end users, as it is end users who are 
  2038. responsible in the first instance for individual account security.
  2039.  
  2040. Without doubt, one of the most popular methods used by computer crackers to
  2041. compromise a system is password stealing.
  2042.  
  2043. By stealing your username and password an intruder can, with reduced
  2044. likelihood of detection, gain access to your system, modify it for his or
  2045. her own purposes and use that system as a launchpad for attacks on other
  2046. systems throughout the world - and all in your name. Password protection is
  2047. one of the most (if not the single most) important principles of system
  2048. security. It is uniformly important for ALL users, regardless of system
  2049. privileges or computer literacy. It is up to each and every individual to
  2050. ensure that their password is safe - a single unsafe password can (and
  2051. probably will) lead to a computer cracker violating YOUR system.
  2052.  
  2053. Your best line of defence against attack is a secure password. A password
  2054. is like a key, and any entry point that allows access by default is not
  2055. secure. A bad password is like leaving your front door unlocked.
  2056.  
  2057. Do not underestimate the ease with which your password can be stolen. There
  2058. are many techniques available to do this. A simple and amazingly successful
  2059. password theft technique for the cracker is password guessing (i.e. entering
  2060. your username, and simply guessing what your password might be). The aim of
  2061. this advisory is to thwart these attempts.
  2062.  
  2063.  
  2064.  
  2065. How To Select A Safe Password
  2066. -----------------------------
  2067.  
  2068. Some systems automatically (and autocratically) allocate passwords to
  2069. users. Many systems, however, give the user the option of selecting his 
  2070. or her own password. The following guidelines should help in selecting a
  2071. password which will be sufficiently robust to prevent a cracker from
  2072. guessing your password in the majority of cases. 
  2073.  
  2074. There are several principles involved in selecting a safe password. These
  2075. are covered below.
  2076.  
  2077.  
  2078. The DO-NOTs
  2079.  
  2080. DO NOT use simple passwords that are easy to remember and are typically 
  2081.     not safe. Examples of such passwords are:
  2082.  
  2083.     -  your userid (a common, but extremely dangerous practice);
  2084.  
  2085.     -  a word which can be associated with you. For example:
  2086.         - your car make, model or registration number
  2087.         - your child's name
  2088.         - your street name, postcode or other address details
  2089.         - your medicare number
  2090.         - your tax file number
  2091.         - any of your bank account numbers;
  2092.  
  2093.     -  a word which someone watching could easily spot (qwertyuiop);
  2094.  
  2095.     -  any dictionary word (which a cracker with a PC and an on-line 
  2096.         dictionary could discover by exhaustive trial);
  2097.  
  2098.     -  words from other guessable word sets such as famous names, 
  2099.         proper names, colloquial terms (in various spheres of
  2100.         life) and so on.
  2101.  
  2102.     It is not sufficient to include a single number in the word, or 
  2103.     change all O's to 0's and I's or L's to 1's in the word, or to spell 
  2104.     the word backwards.
  2105.  
  2106.  
  2107. DO NOT leave your account without a password.
  2108.  
  2109. DO NOT use your userid as your password.
  2110.  
  2111. DO NOT use any word from a dictionary (of any language) as most forms of 
  2112.     password attack use dictionaries as a basis for password guessing.
  2113.  
  2114. DO NOT use birthdays, car registration numbers, room numbers, department names,
  2115.     machine names, locations, wife/husband's names, pet's names,
  2116.     children's names and so on. These may be determined as most of this
  2117.     information is not confidential.
  2118.  
  2119. DO NOT use keyboard patterns, or duplicating characters such as qwerty or
  2120.     aabbccdd.
  2121.  
  2122. DO NOT use the same password on multiple accounts. If you have many accounts,
  2123.     then do not use the same password on each account. If one is broken,
  2124.     then all are broken. Also, do not just change one character in the
  2125.     password as this may be easily spotted if one of the passwords is
  2126.     compromised.
  2127.  
  2128. DO NOT allow anyone to watch while you type your password.
  2129.  
  2130. DO NOT record your password either on-line. DO NOT write down your 
  2131.     passwords.
  2132.  
  2133. DO NOT tell anyone what your password is. Do not share your password with
  2134.     your partner, your children, your friends. Even telling your dog
  2135.     should be considered risky! Do not tell a person verbally, by
  2136.     electronic mail or by any other means.
  2137.  
  2138. Remember: if someone has your password, they can commit criminal acts using
  2139. your account!
  2140.  
  2141. SERT staff have been alerted to several security breaches at constituent
  2142. sites which have been attributed (in total or in part) to the sharing of 
  2143. passwords between husband and wife, parent and child, and between friends.
  2144.  
  2145.  
  2146.  
  2147. The DOs
  2148.  
  2149. DO use a MINIMUM (not maximum!) of 8 or more characters (system permitting).
  2150.  
  2151. DO use mixed case wherever possible. DO NOT choose only the first letter as
  2152.     uppercase. (e.g. Mich37bo is not as good as MicH37Bo.)
  2153.  
  2154. DO include at least two digits or punctuation characters. DO NOT simply replace
  2155.     "o" and "O" with "0", and "I", "l" or "L" with 1. (e.g. fl0pp1mp is
  2156.     not as good as fL0$p*Mp.)
  2157.  
  2158. DO change passwords frequently, and DO NOT reuse old passwords. Password
  2159.     cracking algorithms have been around for quite a while now. By using
  2160.     computationally intensive processes, a password can be broken in time.
  2161.  
  2162. Applying the techniques outlined above make the length of time required to
  2163. break a password prohibitively long. However, the time required to break a
  2164. password drops significantly as each letter is guessed, or other
  2165. information is known about a password. Passwords should be changed
  2166. regularly, so that even if a password is finally guessed, it will be long
  2167. out of date. A password should never be reused.
  2168.  
  2169.  
  2170.  
  2171. General techniques for generating safe passwords include:
  2172.  
  2173. -  using two or three short words that are unrelated;
  2174. -  always including some non-alphabetic, non-numeric (i.e. punctuation)
  2175.     characters;
  2176. -  deliberately misspelling;
  2177. -  taking the first letter from each word of a phrase (a passphrase).
  2178.  
  2179. Note that different operating systems have different rules for the
  2180. characters that one is allowed to use in a password. Some operating systems
  2181. will allow any printable characters, whereas others only allow numeric and
  2182. alphabetic (i.e. non-punctuation) characters.
  2183.  
  2184.  
  2185. After reading all of that, you may ask "well, what is a good password? What
  2186. can I use?". One technique would be to use a two or three word phrase, and
  2187. replace the 1st character of the 1st word with a <shift>-1, the 2nd
  2188. character of the 2nd word with a <shift>-2, etc, and uppercase every second
  2189. character except punctuation. e.g. !Yc@rSm$lLs (my car smells).
  2190.  
  2191. Another alternative might be to use the first letter from each word in a
  2192. line from a song, have every third letter in upper case, and replace (aeiou) 
  2193. with ({}:"?). For example, 'Tie A Yellow Ribbon Round That Old Oak Tree' 
  2194. would convert into 't{YrrT""T'.
  2195.  
  2196. (Rationale:
  2197.    'Tie A Yellow Ribbon Round That Old Oak Tree'            => 'tayrrtoot'
  2198.    Convert every third letter to upper case                 => 'taYrrTooT'
  2199.    Replace lower case vowels                                => 't{YrrT""T')
  2200.  
  2201. Note that these examples should NOT be used as they are now published
  2202. widely!
  2203.  
  2204. You should be aware of what characters your system will accept in a
  2205. password, the length required for a password, and what time period is
  2206. allowed before the password will have to be changed again. You also need to
  2207. be aware of the commands used to change passwords.
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213. What System Managers Can Do
  2214. ---------------------------
  2215.  
  2216. Consider using the following techniques.
  2217.  
  2218. - Use Crack, a password cracking tool to audit existing passwords. You supply
  2219.     a dictionary, and a list of massaging rules. Crack then tests the
  2220.     encrypted password against the dictionary and rules list to see which
  2221.     passwords it can guess. This is only available for UNIX systems.
  2222.  
  2223. - Consider also the use of password shadowing, which places the encrypted
  2224.     passwords in a non-world-readable file, not /etc/passwd (which is
  2225.     world-readable). Again, this is only applicable for UNIX systems.
  2226.  
  2227. - If your system has a facility to enforce rules on minimum password
  2228.     content (e.g. "must include at least 1 upper case and at least 1
  2229.     numeric"), then use this facility. For UNIX systems which don't
  2230.     have this facility, npasswd or passwd+ are good alternatives.
  2231.  
  2232. - If your system has a facility to (a) enforce password ageing, and (b) keep
  2233.     a history file of passwords and disallow previous passwords, then
  2234.     use this facility also.
  2235.  
  2236. - Keep passwords for system accounts distributed amongst the smallest group
  2237.     of people possible. Change these passwords more frequently than
  2238.     passwords for non-privileged accounts.
  2239.  
  2240. - Take care with the use of facilities that are available for logins which
  2241.     bypass the use of passwords. For instance, on VMS systems, don't
  2242.     allow proxy logins for privileged accounts such as "SYSTEM". On UNIX
  2243.     machines, remove any .rhosts files (or /etc/hosts.equiv) with "+"
  2244.     signs in them.
  2245.  
  2246.  
  2247. Login programs (such as /bin/login on UNIX systems) are constructed to 
  2248. behave in a certain way. One method used by crackers to obtain passwords is 
  2249. to execute a program (a trojan horse) masquerading as the login program. 
  2250. The trojan horse will accept your username and password, log it into a 
  2251. secret file, and then inform you that the combination entered was 
  2252. incorrect, before finally calling the real login program. The user, 
  2253. thinking that this was merely a typographical error, will proceed as normal
  2254. unaware that his or her password has been logged for later use. This can be 
  2255. avoided in some cases by typing <Return> a few times before entering your 
  2256. username/password combination.
  2257.  
  2258. Finally, system managers should be aware that X display managers (such as 
  2259. xdm) may bypass several login and system facilities such as message of 
  2260. the day, password ageing etcetera. Depending upon the sensitivity of your 
  2261. site, this may present some problems which will need resolution using more 
  2262. lateral methods.
  2263.  
  2264.  
  2265. If you believe that your system has been compromised, contact SERT or your
  2266. representative in FIRST (Forum of Incident Response and Security Teams).
  2267.  
  2268. Internet Email:    sert@sert.edu.au
  2269. Facsimile:    (07) 365 4477
  2270. Telephone:    (07) 365 4417
  2271.         SERT personnel answer during business hours (AEST).
  2272.  
  2273. Security Emergency Response Team
  2274. Prentice Centre
  2275. The University Of Queensland
  2276. Qld  4072
  2277. AUSTRALIA.
  2278.  
  2279.    
  2280.    
  2281.    
  2282.    
  2283.                             Appendix 3
  2284.                                  
  2285.                                  
  2286.                           Wrapper Example
  2287.    
  2288.    
  2289.    The  following material is an example of a  wrapper  that
  2290.    could conceivably used for protecting the FAL object,  as
  2291.    outlined in Section 4.1, Wrappers.
  2292.    
  2293.    $ SET NOON
  2294.    $ SET NOCONTROL_Y
  2295.    $ SaveVerify = F$VERIFY(0)
  2296.    $ SET NOVERIFY
  2297.    $!
  2298.    ================================================================
  2299.    $!
  2300.    $! Example Wrapper
  2301.    $!
  2302.    $!             *** NOTE: This file is UNTESTED! ***
  2303.    $!
  2304.    $! Author: Rob McMillan, 1992
  2305.    $!
  2306.    $! Example wrapper for the FAL object. This command file should
  2307.    be
  2308.    $! specified as the file to execute for the FAL object in the NCP
  2309.    $! database. This file is for example purposes only!
  2310.    $!
  2311.    $! Create allow and deny lists in AllowFile and DenyFile. The
  2312.    $! format of each file is "HOST::USERNAME.". Note the full stop.
  2313.    $!
  2314.    $! eg
  2315.    $!                        NODE1::USER1.
  2316.    $!
  2317.    $! To have blanket values, use an asterisk *. For instance, to
  2318.    $! have a blanket denial, but allow all people from NODE2::, and
  2319.    $! allow NODE1::USER1, have the following configuration:
  2320.    $!
  2321.    $!                        DenyFile:
  2322.    $!                          *::*.
  2323.    $!
  2324.    $!                        AllowFile:
  2325.    $!                          NODE2::*.
  2326.    $!                          NODE1::USER1.
  2327.    $!
  2328.    $! In the absence of enough information in the configuration
  2329.    $! files, or a clash of information (eg denying and allowing
  2330.    $! *::*), the default action is to deny a connection.
  2331.    $!
  2332.    $!================================================================
  2333.    $!
  2334.    $!  -- What object is this wrapper for?
  2335.    $!
  2336.    $ Executable = "SYS$SYSTEM:FAL.EXE"         ! Object executable to use
  2337.    $!
  2338.    $!  -- Constants
  2339.    $!
  2340.    $ WAllowed == %x10000001
  2341.    $ WDenied  == %x10000002
  2342.    $ WUnknown == %x10000003
  2343.    $!
  2344.    $!  -- Get connection details
  2345.    $!
  2346.    $ LocalNodeName  = F$GETSYI("NODENAME") + "::"
  2347.    $ LocalTime      = F$TIME()
  2348.    $ LocalUser      = F$GETJPI("","USERNAME")
  2349.    $ LocalUser      = F$EXTRACT(0,F$LOCATE(" ",LocalUser),LocalUser)
  2350.    $ RemoteNodeName = F$TRNLNM("SYS$REM_NODE")
  2351.    $ RemoteUser     = F$TRNLNM("SYS$REM_ID")
  2352.    $ WrapperLogInfo = -
  2353.      "at ''LocalTime' from ''RemoteNodeName'::''RemoteUser' as ''LocalUser'"
  2354.    $!
  2355.    $!  -- Check wrapper configuration
  2356.    $!
  2357.    $! At this point, we can use any of the following to check
  2358.    $! whether we'll allow the connection:
  2359.    $!
  2360.    $!        - LocalNode
  2361.    $!        - LocalTime
  2362.    $!        - LocalUser
  2363.    $!        - RemoteNodeName
  2364.    $!        - RemoteUser
  2365.    $!
  2366.    $ ConnectionOkay = WUnknown
  2367.    $ CheckFALRules 'LocalNodeName' 'LocalTime' 'LocalUser' -
  2368.                    'RemoteNodeName'            'RemoteUser'
  2369.    $ ConnectionOkay = $Status
  2370.    $ IF (RemoteNodeName .EQS. LocalNodeName)
  2371.    $ THEN
  2372.    $    ConnectionOkay = WAllowed   ! Failsafe
  2373.    $ ENDIF
  2374.    $!
  2375.    $!  -- Log the event and take action
  2376.    $!
  2377.    $ IF (ConnectionOkay .NE. WAllowed)
  2378.    $ THEN
  2379.    $   WRITE SYS$OUTPUT "Network connect request failed ''WrapperLogInfo'"
  2380.    $   WriteFALLog "Network connect request failed ''WrapperLogInfo'"
  2381.    $   LOGOUT
  2382.    $ ELSE
  2383.    $   WRITE SYS$OUTPUT "Network connect request succeeded ''WrapperLogInfo'"
  2384.    $   WriteFALLog "Network connect request succeeded ''WrapperLogInfo'"
  2385.    $   RUN 'Executable'
  2386.    $ ENDIF
  2387.    $!
  2388.    $!  -- Go home now
  2389.    $!
  2390.    $ SaveVerify = F$VERIFY(SaveVerify)
  2391.    $ EXIT 'ConnectionOkay'
  2392.    
  2393.  
  2394.    For   interactive  connections,  the  section  in   which
  2395.    connection   details   are  evaluated   would   be   more
  2396.    complicated.  Different mechanisms would be required  for
  2397.    finding  out  these  details  based  upon  the  type   of
  2398.    connection  (eg  local, DECnet, LAT, telnet).  These  are
  2399.    mentioned  in Section 4.1, Wrappers. These command  files
  2400.    should  be  world  executable,  but  only  readable   and
  2401.    writeable by system privileged users.
  2402.    
  2403.    The   two  executables,  CheckFALRules  and  WriteFALLog,
  2404.    should  be  similarly protected (eg installed,  protected
  2405.    images).  WriteFALLog  is  a very  simple  program  which
  2406.    writes  the supplied parameters to the log file for  this
  2407.    object.  CheckFALRules  could  look  something  like  the
  2408.    following example.
  2409.    
  2410.    
  2411.    
  2412.    /*
  2413.     * CheckFALRules.C
  2414.     *
  2415.     * Author: Rob McMillan, 1992
  2416.     *
  2417.     *  Use current connection details to compare with local rules and
  2418.     *  return a value describing whether to allow the connection or
  2419.     *  not (Allow).
  2420.     *
  2421.     *  The returned value (Allow) can return one of two values:
  2422.     *        WAllowed: allow the connection
  2423.     *        WDenied:  refuse the connection
  2424.     *
  2425.     *  This wrapper configuration tests only upon the basis of
  2426.     *  RemoteNodeName and RemoteUser. However, any of the details
  2427.     *  supplied below can be used, based upon paranoia levels. To
  2428.     *  do this, the following must be modified:
  2429.     *
  2430.     *           - The CHECK_EXPLICIT_RULE subroutine
  2431.     *           - The calls in this subroutine to CHECK_EXPLICIT_RULE
  2432.     *           - The header comments at the top of this wrapper
  2433.     *            - The allow and deny files.
  2434.     *
  2435.     */
  2436.    
  2437.    
  2438.    #include <ssdef.h>
  2439.    #include <stdio.h>
  2440.    #include <stdlib.h>
  2441.    #include <string.h>
  2442.    
  2443.    #include "CheckFALRules.H"
  2444.    
  2445.    typedef unsigned int     BOOLEAN;
  2446.    #define FALSE       0
  2447.    #define TRUE        1
  2448.    
  2449.    
  2450.    /* -- Prototypes */
  2451.    int                CheckExplicitRule( char *, char *);
  2452.    int                ExitHandler(int, char *);
  2453.    char *              Salloc(unsigned int);
  2454.    char *              SnarfArgument(char *);
  2455.    
  2456.    int
  2457.    main (argc, argv)
  2458.    int                argc;
  2459.    char *  argv[];
  2460.    {
  2461.     char *       localNodeName;
  2462.     char *       localTime;
  2463.     char *       localUser;
  2464.     char *       remoteNodeName;
  2465.     char *       remoteUser;
  2466.     int     status = WUnknown;
  2467.    
  2468.     /* Get and display parameters */
  2469.    
  2470.     localNodeName= SnarfArgument(argv[1]);
  2471.     localTime         = SnarfArgument(argv[2]);
  2472.     localUser         = SnarfArgument(argv[3]);
  2473.     remoteNodeName    = SnarfArgument(argv[4]);
  2474.     remoteUser        = SnarfArgument(argv[5]);
  2475.      if ((localNodeName == (char *)0)      ||
  2476.          (localTime == (char *)0)          ||
  2477.          (localUser == (char *)0)          ||
  2478.          (remoteNodeName == (char *)0)     ||
  2479.          (remoteUser == (char *)0)
  2480.         ) {
  2481.           fprintf( stderr, "Error snarfing check parameters!\n");
  2482.           exit( ExitHandler( WDefault, "Error snarfing check
  2483.                           parameters!"));
  2484.      }
  2485.    
  2486.     /* Now evaluate whether to allow the connection */
  2487.    
  2488.            /* -- We will only test based on source node and user.
  2489.             *    We can check other details if required at a later stage.
  2490.             *
  2491.             *     Note that the order in which these rules are checked is
  2492.             *     important. Below, we check in the order of the most
  2493.             *     specific rule to the most general. Once a connection
  2494.             *     is found to be explicitly allowed or denied
  2495.             *     no further rules are checked.
  2496.             */
  2497.    
  2498.      status = CheckExplicitRule( remoteNodeName, remoteUser);
  2499.      if (status != WUnknown)
  2500.        exit( ExitHandler( status, "On node::user combination"));
  2501.    
  2502.      status = CheckExplicitRule( remoteNodeName, "*");
  2503.      if (status != WUnknown)
  2504.        exit( ExitHandler( status, "On node::* combination"));
  2505.    
  2506.      status = CheckExplicitRule( "*", "*");
  2507.      if (status != WUnknown)
  2508.        exit( ExitHandler( status, "On *::* combination"));
  2509.    
  2510.           /* No applicable rules were found, or there were a clash of
  2511.            * rules, so use the default.
  2512.            */
  2513.      fprintf(stderr, "Warning! Unable to evaluate connection status!\n");
  2514.      exit ( ExitHandler( WDefault, "Default action taken"));
  2515.    }     /* end main */
  2516.    
  2517.    /*
  2518.     * CheckExplicitRule
  2519.     *
  2520.     *  Use the remoteNodeName and remoteUser to return a value
  2521.     *  describing whether the proposed connection is explicitly allowed
  2522.     *  or denied. The returned value can be one of three values:
  2523.     *
  2524.     *      WAllowed: explicitly allow the connection
  2525.     *      WDenied:  explicitly deny the connection
  2526.     *      WUnknown: couldn't evaluate on supplied information
  2527.     *
  2528.     *       Allowed configurations are set out in ALLOW_FILE.
  2529.     *       Disallowed configurations are set out in DENY_FILE.
  2530.     *
  2531.     *  If the record is found in both files, or the record can't be
  2532.     *  found in either file, return WUnknown. Otherwise, return
  2533.     *  the result explicitly described by the files.
  2534.     *
  2535.     */
  2536.    int
  2537.    CheckExplicitRule( remoteNodeName, remoteUser)
  2538.    char *  remoteNodeName;
  2539.    char *  remoteUser;
  2540.    {
  2541.         char          inbuf[132];     /* Should be heaps */
  2542.         char *        searchKey;
  2543.         BOOLEAN       allow = WUnknown;
  2544.         BOOLEAN       foundAllow = FALSE;
  2545.         BOOLEAN       foundDeny = FALSE;
  2546.         FILE *        fp;
  2547.    
  2548.    
  2549.      if ((searchKey = Salloc(strlen(remoteNodeName) + 3 +
  2550.                         strlen(remoteUser))) == (char *)0)
  2551.           return( WUnknown);
  2552.         searchKey = strcpy(searchKey, remoteNodeName);
  2553.         searchKey = strcat(searchKey, "::");
  2554.         searchKey = strcat(searchKey, remoteUser);
  2555.                                  
  2556.    /* See if there is a matching record in the allow file */
  2557.    if ((fp = fopen( ALLOW_FILE, "r")) == (FILE *)NULL) {
  2558.      fprintf(stderr, "Error! Cannot open wrapper AllowFile! \n");
  2559.      return( WUnknown);
  2560.    }
  2561.    else {
  2562.      /* Search file for matching record */
  2563.      while ((foundAllow == FALSE) && (fgets(inbuf, 132, fp) != (char *)NULL))
  2564.        if (strncmp(searchKey, inbuf, strlen(searchKey)) == 0)
  2565.          foundAllow = TRUE;
  2566.      fclose(fp);
  2567.      }
  2568.    
  2569.    /* Now search deny file as well */
  2570.    if ((fp = fopen( DENY_FILE, "r")) == (FILE *)NULL) {
  2571.      fprintf(stderr, "Error! Cannot open wrapper DenyFile! \n");
  2572.      return( WUnknown);
  2573.    }
  2574.    else {
  2575.      /* Search file for matching record */
  2576.      while ((foundDeny == FALSE) && (fgets(inbuf, 132, fp) != (char *)NULL))
  2577.        if (strncmp(searchKey, inbuf, strlen(searchKey)) == 0)
  2578.          foundDeny = TRUE;
  2579.      fclose(fp);
  2580.      }
  2581.    
  2582.    /* If we get a strict decision, then return the result. If we
  2583.     * get two FALSEs or two TRUEs, then there is no decision.
  2584.     */
  2585.    if ((foundAllow == TRUE) && (foundDeny == FALSE))
  2586.      allow = WAllowed;
  2587.    if ((foundAllow == FALSE) && (foundDeny == TRUE))
  2588.      allow = WDenied;
  2589.    
  2590.      return( allow);
  2591.    
  2592.    }  /* end CheckExplicitRule */
  2593.    
  2594.    /*
  2595.     * ExitHandler
  2596.     *
  2597.     * Carry out any cleaning up required whilst exiting.
  2598.     *
  2599.     */
  2600.    int
  2601.    ExitHandler( exitCode, diagnostic)
  2602.    int             exitCode;
  2603.    char *          diagnostic;
  2604.    {
  2605.    
  2606.    #ifdef DEBUG
  2607.      switch (exitCode) {
  2608.        case WAllowed:
  2609.        fprintf( stdout, "\nConnection allowed: ");
  2610.        fprintf( stdout, "%s.\n", diagnostic);
  2611.        break;
  2612.      case WDenied:
  2613.        fprintf( stdout, "\nConnection denied: ");
  2614.        fprintf( stdout, "%s.\n", diagnostic);
  2615.        break;
  2616.      case WUnknown:
  2617.        fprintf( stdout, "\nCan't figure out to allow connection or not: ");
  2618.        fprintf( stdout, "%s.\n", diagnostic);
  2619.        break;
  2620.      default:
  2621.        fprintf( stdout, "\nError. Unknown exit code: ");
  2622.        fprintf( stdout, "%s.\n", diagnostic);
  2623.        break;
  2624.      }
  2625.    #endif
  2626.    
  2627.     return( exitCode);
  2628.    } /* end ExitHandler */
  2629.    
  2630.    
  2631.    /*
  2632.     * Salloc
  2633.     *
  2634.     * Safe malloc
  2635.     *
  2636.     * See P321 "C Programming in a UNIX Environment"
  2637.     *            by Judy Kay and Bob Kummerfeld,
  2638.     *            Addison-Wesley, 1989.
  2639.     *
  2640.     */
  2641.    char *
  2642.    Salloc(size)
  2643.    unsigned int    size;
  2644.    {
  2645.        char * result;
  2646.        if ((result = malloc(size)) == (char *)0)
  2647.          fprintf(stderr, "Cannot malloc %d bytes.\n", size);
  2648.        return result;
  2649.    } /* end Salloc */
  2650.    
  2651.    /*
  2652.     * SnarfArgument
  2653.     *
  2654.     * Make a copy of arg string.
  2655.     *
  2656.     */
  2657.    char *
  2658.    SnarfArgument( arg)
  2659.    char *  arg;
  2660.    {
  2661.      char * result;
  2662.    
  2663.      if ((result = Salloc(strlen(arg)+1)) != (char *)0)
  2664.        result = strcpy(result, arg);
  2665.      return( result);
  2666.    } /* end SnarfArgument */
  2667.    
  2668.    
  2669.    The header file for this program would contain the following:
  2670.    
  2671.    /*
  2672.     * CheckFALRules.H
  2673.     *
  2674.     * Author: Rob McMillan, 1992
  2675.     *
  2676.     *  See comments in CheckFALRules.C.
  2677.     *
  2678.     * THE CONTENTS OF THIS FILE MUST MATCH THOSE IN THE WRAPPER COMMAND FILE!
  2679.     *
  2680.     */
  2681.    
  2682.    /* -- Define file paths */
  2683.    #define DEBUG
  2684.    #ifdef  DEBUG
  2685.    #define ALLOW_FILE  "{Allow File name here}"
  2686.    #define DENY_FILE   "{Deny File name here}"
  2687.    #else
  2688.    #define ALLOW_FILE  "local$wrap:{Allow File name here}"
  2689.    #define DENY_FILE   "local$wrap:{Deny File name here}"
  2690.    #endif
  2691.    
  2692.    /* -- Define exit values */
  2693.    #define WAllowed    0x10000001
  2694.    #define WDenied     0x10000002
  2695.    #define WUnknown    0x10000003
  2696.    #define WDefault    WDenied
  2697.